import { ref as ref$1, computed, onMounted, onBeforeUnmount, openBlock, createElementBlock, createElementVNode, watch, toRefs, getCurrentInstance, resolveComponent, Fragment, createVNode, withCtx, unref, createBlock, createCommentVNode, renderSlot, createTextVNode, renderList, toDisplayString, normalizeStyle, normalizeClass, inject, withDirectives, vShow, resolveDynamicComponent, reactive, createSlots, TransitionGroup, mergeProps, withModifiers, provide, nextTick, onUnmounted, getCurrentScope, onScopeDispose, effectScope, shallowRef, Teleport, Transition } from "vue";
import ace from "ace-builds";
import "ace-builds/src-min-noconflict/mode-javascript";
import "ace-builds/src-min-noconflict/mode-json5";
import "ace-builds/src-min-noconflict/theme-eclipse";
import "ace-builds/src-min-noconflict/ext-language_tools";
import "ace-builds/src-min-noconflict/mode-text";
import "ace-builds/src-min-noconflict/theme-chrome";
import _ from "lodash";
import draggable from "@marshallswain/vuedraggable";
import { showToast } from "vant";
import moment from "moment";
import axios from "axios";
import { ElMessageBox, ElMessage } from "element-plus";
const _export_sfc = (sfc, props2) => {
  const target = sfc.__vccOpts || sfc;
  for (const [key, val] of props2) {
    target[key] = val;
  }
  return target;
};
const _sfc_main$T = {
  name: "CodeEditor",
  props: {
    modelValue: {
      type: String,
      default: ""
    },
    /** 只读模式 */
    readonly: {
      type: Boolean,
      default: false
    },
    /** 语言模式支持javascript、json、css */
    mode: {
      type: String,
      default: "javascript"
    },
    /** 显示行号 */
    showGutter: {
      type: Boolean,
      default: true
    },
    /** 最大行数，超过会自动出现滚动条 */
    maxLines: {
      type: Number,
      default: 20
    },
    /** 最小行数 */
    minLines: {
      type: Number,
      default: 20
    },
    /** 是否开启语法检查 */
    userWorker: {
      type: Boolean,
      default: true
    },
    /** 字体大小 */
    fontSize: {
      type: Number,
      default: 14
    }
  },
  emits: ["update:modelValue"],
  setup(props2, { emit }) {
    let editor = null;
    const editorRef = ref$1(null);
    const codeValue = computed(() => props2.modelValue);
    const options2 = {
      mode: `ace/mode/${props2.mode}`,
      // 设置语法模式
      theme: "ace/theme/eclipse",
      // 设置主题
      fontSize: props2.fontSize,
      // 字体大小
      showPrintMargin: false,
      // 隐藏边线
      showGutter: props2.showGutter,
      // 显示行号
      enableSnippets: true,
      // 代码片段功能
      enableBasicAutocompletion: true,
      // 启用自动补全
      enableLiveAutocompletion: true,
      // 实时补全
      maxLines: props2.maxLines,
      // 最大行数，超过会自动出现滚动条
      minLines: props2.minLines,
      // 最小行数，还未到最大行数时，编辑器会自动伸缩大小
      tabSize: 2,
      // 制表符设置为2个空格大小
      readOnly: props2.readonly,
      highlightActiveLine: true,
      value: codeValue.value
    };
    onMounted(() => {
      ace.config.set(
        "basePath",
        "https://fastly.jsdelivr.net/npm/ace-builds@1.32.3/src-noconflict/"
        // 或本地路径：new URL('node_modules/ace-builds/src-noconflict/', import.meta.url).href
      );
      editor = window.ace.edit(editorRef.value, options2);
      editor.getSession().setUseWrapMode(props2.userWorker);
      editor.on("change", () => {
        if (emit) {
          emit("update:modelValue", editor.getValue());
        }
      });
    });
    onBeforeUnmount(() => {
      editor.destroy();
    });
    return { editorRef };
  }
};
const _hoisted_1$D = { class: "ace-container" };
const _hoisted_2$q = {
  ref: "editorRef",
  class: "ep-ace-editor"
};
function _sfc_render$v(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("div", _hoisted_1$D, [
    createElementVNode("div", _hoisted_2$q, null, 512)
  ]);
}
const CodeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["render", _sfc_render$v]]);
const _sfc_main$S = {
  name: "CodeEditorFormula",
  props: {
    modelValue: {
      type: String,
      default: ""
    }
  },
  emits: ["update:modelValue"],
  setup(props2, { emit }) {
    let editor = null;
    const editorRef = ref$1(null);
    const codeValue = computed(() => props2.modelValue);
    const options2 = {
      mode: `ace/mode/text`,
      // 设置语法模式
      theme: "ace/theme/chrome",
      // 设置主题
      fontSize: 14,
      // 字体大小
      showPrintMargin: false,
      // 隐藏边线
      showGutter: false,
      // 不显示行号
      enableBasicAutocompletion: true,
      // 启用自动补全
      enableLiveAutocompletion: true,
      // 实时补全
      maxLines: 18,
      // 最大行数，超过会自动出现滚动条
      minLines: 18,
      // 最小行数，还未到最大行数时，编辑器会自动伸缩大小
      tabSize: 2,
      // 制表符设置为2个空格大小
      highlightActiveLine: true,
      value: codeValue.value
    };
    const defineCustomHighlightRules = () => {
      const oop = ace.require("ace/lib/oop");
      const TextHighlightRules = ace.require("ace/mode/text_highlight_rules").TextHighlightRules;
      const CustomHighlightRules = function() {
        this.functionKeywords = [
          // 逻辑函数
          "IF",
          "AND",
          "OR",
          "NOT",
          "XOR",
          // 比较函数
          "EQ",
          "NE",
          "GT",
          "GE",
          "LT",
          "LE",
          // 数学函数
          "ADD",
          "SUB",
          "MUL",
          "DIV",
          "MOD",
          "POW",
          // 循环函数
          "SUM",
          "PRODUCT",
          "COUNT",
          "AVERAGE",
          "MIN",
          "MAX",
          // 日期函数
          "DATE",
          "DATEDIFF",
          "DAY",
          "MONTH",
          "YEAR",
          // 文本函数
          "CONCAT",
          "LEN",
          "LEFT",
          "RIGHT",
          // 数组函数
          "MAP",
          "FILTER",
          "REDUCE",
          "ARRAY"
        ];
        var functionRegex = "\\b(" + this.functionKeywords.join("|") + ")\\b";
        this.$rules = {
          start: [
            {
              token: "entity.name.function",
              // 表单属性（变量）
              regex: "\\{[^{}]+\\}"
            },
            {
              token: "keyword",
              // 函数名
              regex: functionRegex
            },
            {
              token: "keyword",
              // 括号
              regex: "[\\[\\(\\{\\)\\}\\]]"
            },
            {
              token: "variable.parameter",
              // 参数（变量）
              regex: "[a-zA-Z_$][a-zA-Z0-9_$]*"
            },
            {
              token: "string",
              // 字符串
              regex: '"(?:[^"\\\\]|\\\\.)*"'
            },
            {
              token: "comment",
              // 注释
              regex: "//.*$",
              next: "start"
            },
            {
              token: "comment",
              // 多行注释
              regex: "/\\*",
              next: "comment"
            },
            {
              token: "comment",
              // 多行注释结束
              regex: "\\*/",
              next: "start"
            },
            {
              token: "constant.language.boolean",
              // 布尔值
              regex: "\\b(?:true|false)\\b"
            },
            {
              token: "constant.numeric",
              // 数字
              regex: "\\b\\d+(\\.\\d+)?\\b"
            },
            {
              token: "keyword.operator",
              // 操作符
              regex: "[=<>!&|\\+\\-\\*/%]"
            },
            {
              token: "comma",
              // 逗号
              regex: ","
            }
          ]
        };
      };
      oop.inherits(CustomHighlightRules, TextHighlightRules);
      return CustomHighlightRules;
    };
    const defineCustomMode = (CustomHighlightRules) => {
      const oop = ace.require("ace/lib/oop");
      const TextMode = ace.require("ace/mode/text").Mode;
      const Mode = function() {
        this.HighlightRules = CustomHighlightRules;
      };
      oop.inherits(Mode, TextMode);
      return Mode;
    };
    watch(codeValue, (val) => {
      if (editor && val !== editor.getValue()) {
        editor.setValue(val);
      }
    });
    onMounted(() => {
      ace.config.set("basePath", "https://fastly.jsdelivr.net/npm/ace-builds@1.32.3/src-noconflict/");
      editor = window.ace.edit(editorRef.value, options2);
      const CustomHighlightRules = defineCustomHighlightRules();
      const CustomMode = defineCustomMode(CustomHighlightRules);
      const customMode = new CustomMode();
      editor.session.setMode(customMode);
      editor.on("change", () => {
        if (emit) {
          emit("update:modelValue", editor.getValue());
        }
      });
    });
    onBeforeUnmount(() => {
      editor.destroy();
      editor.container.remove();
    });
    const insertValue = (text) => {
      const cursor = editor.getCursorPosition();
      editor.session.insert(cursor, String(text));
    };
    const setValue = (text) => {
      editor.session.setValue(String(text));
    };
    const focus = (n = 0) => {
      const { row, column } = editor.getCursorPosition();
      editor.focus();
      editor.gotoLine(row + 1, column + n);
    };
    return { editorRef, insertValue, setValue, focus };
  }
};
const _hoisted_1$C = { class: "ace-container" };
const _hoisted_2$p = {
  ref: "editorRef",
  class: "ep-ace-editor"
};
function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("div", _hoisted_1$C, [
    createElementVNode("div", _hoisted_2$p, null, 512)
  ]);
}
const CodeEditorFormula = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["render", _sfc_render$u]]);
const propsDefinition = {
  selected: {
    type: Object,
    default: null
  },
  /** Json表单 */
  widgetList: {
    type: Array,
    default: null
  },
  fieldConfig: {
    type: Object,
    default: null
  },
  formConfig: {
    type: Object,
    default: null
  }
};
const _sfc_main$R = {
  __name: "base-option",
  props: propsDefinition,
  setup(__props) {
    const props2 = __props;
    const { selected, fieldConfig } = toRefs(props2);
    const { proxy } = getCurrentInstance();
    const handleChange = () => {
      if (!fieldConfig.value.name) {
        fieldConfig.value.name = props2.selected.id;
        proxy.$message.error("组件名称不能为空");
      }
    };
    const hideOptions = (opt) => {
      const _opts = selected.value.hideOptions || [];
      if (_opts.includes(opt)) {
        return false;
      }
      return true;
    };
    return (_ctx, _cache) => {
      const _component_el_input = resolveComponent("el-input");
      const _component_el_form_item = resolveComponent("el-form-item");
      const _component_el_switch = resolveComponent("el-switch");
      const _component_el_tooltip = resolveComponent("el-tooltip");
      const _component_el_checkbox = resolveComponent("el-checkbox");
      const _component_el_form = resolveComponent("el-form");
      const _component_el_tab_pane = resolveComponent("el-tab-pane");
      const _component_QuestionFilled = resolveComponent("QuestionFilled");
      const _component_el_icon = resolveComponent("el-icon");
      const _component_el_popover = resolveComponent("el-popover");
      const _component_el_option = resolveComponent("el-option");
      const _component_el_select = resolveComponent("el-select");
      return openBlock(), createElementBlock(Fragment, null, [
        createVNode(_component_el_tab_pane, {
          name: "field",
          label: "属性"
        }, {
          default: withCtx(() => [
            unref(selected).id ? (openBlock(), createBlock(_component_el_form, {
              key: 0,
              model: unref(fieldConfig),
              "label-width": "90px",
              "label-position": "left",
              size: "small",
              onChange: handleChange
            }, {
              default: withCtx(() => [
                unref(fieldConfig).name !== void 0 && hideOptions("name") ? (openBlock(), createBlock(_component_el_form_item, {
                  key: 0,
                  label: "唯一标识",
                  prop: "name"
                }, {
                  default: withCtx(() => [
                    createVNode(_component_el_input, {
                      modelValue: unref(fieldConfig).name,
                      "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(fieldConfig).name = $event),
                      readonly: true
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                })) : createCommentVNode("", true),
                unref(fieldConfig).label !== void 0 && hideOptions("label") ? (openBlock(), createBlock(_component_el_form_item, {
                  key: 1,
                  label: "标签名称"
                }, {
                  default: withCtx(() => [
                    createVNode(_component_el_input, {
                      modelValue: unref(fieldConfig).label,
                      "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(fieldConfig).label = $event),
                      maxlength: "100"
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                })) : createCommentVNode("", true),
                unref(fieldConfig).placeholder !== void 0 && hideOptions("placeholder") ? (openBlock(), createBlock(_component_el_form_item, {
                  key: 2,
                  label: "占位提示"
                }, {
                  default: withCtx(() => [
                    createVNode(_component_el_input, {
                      modelValue: unref(fieldConfig).placeholder,
                      "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(fieldConfig).placeholder = $event),
                      maxlength: "100"
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                })) : createCommentVNode("", true),
                renderSlot(_ctx.$slots, "default", { hideOptions }),
                unref(fieldConfig).readonly !== void 0 && hideOptions("readonly") ? (openBlock(), createBlock(_component_el_form_item, {
                  key: 3,
                  label: "只读"
                }, {
                  default: withCtx(() => [
                    createVNode(_component_el_switch, {
                      modelValue: unref(fieldConfig).readonly,
                      "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => unref(fieldConfig).readonly = $event),
                      size: "default"
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                })) : createCommentVNode("", true),
                unref(fieldConfig).disabled !== void 0 && hideOptions("disabled") ? (openBlock(), createBlock(_component_el_form_item, {
                  key: 4,
                  label: "禁用"
                }, {
                  default: withCtx(() => [
                    createVNode(_component_el_switch, {
                      modelValue: unref(fieldConfig).disabled,
                      "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => unref(fieldConfig).disabled = $event),
                      size: "default"
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                })) : createCommentVNode("", true),
                unref(fieldConfig).clearable !== void 0 && hideOptions("clearable") ? (openBlock(), createBlock(_component_el_form_item, {
                  key: 5,
                  label: "一键清空"
                }, {
                  default: withCtx(() => [
                    createVNode(_component_el_tooltip, {
                      effect: "light",
                      content: "H5表单中不生效",
                      placement: "right"
                    }, {
                      default: withCtx(() => [
                        createVNode(_component_el_switch, {
                          modelValue: unref(fieldConfig).clearable,
                          "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => unref(fieldConfig).clearable = $event),
                          size: "default"
                        }, null, 8, ["modelValue"])
                      ]),
                      _: 1
                    })
                  ]),
                  _: 1
                })) : createCommentVNode("", true),
                unref(fieldConfig).required !== void 0 && hideOptions("required") ? (openBlock(), createBlock(_component_el_form_item, {
                  key: 6,
                  label: "必填字段"
                }, {
                  default: withCtx(() => [
                    createVNode(_component_el_switch, {
                      modelValue: unref(fieldConfig).required,
                      "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => unref(fieldConfig).required = $event),
                      size: "default"
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                })) : createCommentVNode("", true),
                unref(fieldConfig).required !== void 0 && hideOptions("requiredMessage") ? (openBlock(), createBlock(_component_el_form_item, {
                  key: 7,
                  label: "校验提示"
                }, {
                  default: withCtx(() => [
                    createVNode(_component_el_input, {
                      modelValue: unref(fieldConfig).requiredMessage,
                      "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => unref(fieldConfig).requiredMessage = $event),
                      disabled: !unref(fieldConfig).required,
                      maxlength: "100"
                    }, null, 8, ["modelValue", "disabled"])
                  ]),
                  _: 1
                })) : createCommentVNode("", true),
                unref(fieldConfig).workflow !== void 0 && hideOptions("workflow") ? (openBlock(), createBlock(_component_el_form_item, {
                  key: 8,
                  label: ""
                }, {
                  default: withCtx(() => [
                    createVNode(_component_el_checkbox, {
                      modelValue: unref(fieldConfig).workflow,
                      "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => unref(fieldConfig).workflow = $event),
                      label: "加入审批流程条件使用"
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                })) : createCommentVNode("", true)
              ]),
              _: 3
            }, 8, ["model"])) : createCommentVNode("", true)
          ]),
          _: 3
        }),
        renderSlot(_ctx.$slots, "base-advanced", {}, () => [
          createVNode(_component_el_tab_pane, {
            name: "advanced",
            label: "高级"
          }, {
            default: withCtx(() => [
              unref(selected).id ? (openBlock(), createBlock(_component_el_form, {
                key: 0,
                model: unref(fieldConfig),
                "label-width": "90px",
                "label-position": "left",
                size: "small"
              }, {
                default: withCtx(() => [
                  renderSlot(_ctx.$slots, "advanced", {}, () => [
                    createVNode(_component_el_form_item, { label: "标签位置" }, {
                      label: withCtx(() => [
                        createElementVNode("div", null, [
                          _cache[11] || (_cache[11] = createTextVNode(" 标签位置 ")),
                          createVNode(_component_el_popover, {
                            placement: "top-start",
                            title: "",
                            width: 200,
                            trigger: "hover",
                            content: "默认继承全局表单设置。"
                          }, {
                            reference: withCtx(() => [
                              createVNode(_component_el_icon, null, {
                                default: withCtx(() => [
                                  createVNode(_component_QuestionFilled)
                                ]),
                                _: 1
                              })
                            ]),
                            _: 1
                          })
                        ])
                      ]),
                      default: withCtx(() => [
                        createVNode(_component_el_select, {
                          modelValue: unref(fieldConfig).labelPosition,
                          "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => unref(fieldConfig).labelPosition = $event),
                          placeholder: "继承"
                        }, {
                          default: withCtx(() => [
                            createVNode(_component_el_option, {
                              label: "继承",
                              value: ""
                            }),
                            createVNode(_component_el_option, {
                              label: "左侧对齐",
                              value: "left"
                            }),
                            createVNode(_component_el_option, {
                              label: "右侧对齐",
                              value: "right"
                            }),
                            createVNode(_component_el_option, {
                              label: "顶部对齐",
                              value: "top"
                            })
                          ]),
                          _: 1
                        }, 8, ["modelValue"])
                      ]),
                      _: 1
                    }),
                    createVNode(_component_el_form_item, { label: "输入框位置" }, {
                      label: withCtx(() => [
                        createElementVNode("div", null, [
                          _cache[12] || (_cache[12] = createTextVNode(" 输入框位置 ")),
                          createVNode(_component_el_popover, {
                            placement: "top-start",
                            title: "",
                            width: 200,
                            trigger: "hover",
                            content: "输入框对齐方式，仅移动端有效。"
                          }, {
                            reference: withCtx(() => [
                              createVNode(_component_el_icon, null, {
                                default: withCtx(() => [
                                  createVNode(_component_QuestionFilled)
                                ]),
                                _: 1
                              })
                            ]),
                            _: 1
                          })
                        ])
                      ]),
                      default: withCtx(() => [
                        createVNode(_component_el_select, {
                          modelValue: unref(fieldConfig).inputAlign,
                          "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => unref(fieldConfig).inputAlign = $event),
                          placeholder: "继承"
                        }, {
                          default: withCtx(() => [
                            createVNode(_component_el_option, {
                              label: "继承",
                              value: ""
                            }),
                            createVNode(_component_el_option, {
                              label: "左侧对齐",
                              value: "left"
                            }),
                            createVNode(_component_el_option, {
                              label: "居中对齐",
                              value: "center"
                            }),
                            createVNode(_component_el_option, {
                              label: "右侧对齐",
                              value: "right"
                            })
                          ]),
                          _: 1
                        }, 8, ["modelValue"])
                      ]),
                      _: 1
                    })
                  ])
                ]),
                _: 3
              }, 8, ["model"])) : createCommentVNode("", true)
            ]),
            _: 3
          })
        ])
      ], 64);
    };
  }
};
const _hoisted_1$B = { style: { "padding-left": "82px" } };
const _sfc_main$Q = {
  __name: "amount-option",
  props: propsDefinition,
  setup(__props) {
    const props2 = __props;
    const { selected, fieldConfig, formConfig } = toRefs(props2);
    return (_ctx, _cache) => {
      const _component_el_input_number = resolveComponent("el-input-number");
      const _component_el_form_item = resolveComponent("el-form-item");
      const _component_el_radio = resolveComponent("el-radio");
      const _component_el_radio_group = resolveComponent("el-radio-group");
      const _component_el_checkbox = resolveComponent("el-checkbox");
      return openBlock(), createBlock(_sfc_main$R, {
        selected: unref(selected),
        "field-config": unref(fieldConfig),
        "form-config": unref(formConfig)
      }, {
        default: withCtx(({ hideOptions }) => [
          hideOptions("min") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 0,
            label: "最小值"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input_number, {
                modelValue: unref(fieldConfig).min,
                "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(fieldConfig).min = $event),
                min: 0,
                max: unref(fieldConfig).max,
                "controls-position": "right"
              }, null, 8, ["modelValue", "max"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          hideOptions("max") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 1,
            label: "最大值"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input_number, {
                modelValue: unref(fieldConfig).max,
                "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(fieldConfig).max = $event),
                min: unref(fieldConfig).min,
                max: 999999999999999,
                "controls-position": "right"
              }, null, 8, ["modelValue", "min"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          unref(fieldConfig).decimalPlaces !== void 0 && hideOptions("decimalPlaces") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 2,
            label: "小数位数"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_radio_group, {
                modelValue: unref(fieldConfig).decimalPlaces,
                "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(fieldConfig).decimalPlaces = $event)
              }, {
                default: withCtx(() => [
                  createVNode(_component_el_radio, { value: 1 }, {
                    default: withCtx(() => _cache[4] || (_cache[4] = [
                      createTextVNode("1位")
                    ])),
                    _: 1
                  }),
                  createVNode(_component_el_radio, { value: 2 }, {
                    default: withCtx(() => _cache[5] || (_cache[5] = [
                      createTextVNode("2位")
                    ])),
                    _: 1
                  })
                ]),
                _: 1
              }, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          createElementVNode("div", _hoisted_1$B, [
            createVNode(_component_el_checkbox, {
              modelValue: unref(fieldConfig).omitEndZero,
              "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => unref(fieldConfig).omitEndZero = $event),
              label: "省略末尾的0"
            }, null, 8, ["modelValue"])
          ])
        ]),
        _: 1
      }, 8, ["selected", "field-config", "form-config"]);
    };
  }
};
class ExcelFormulaParser {
  /**
   * 构造函数
   * @param {Object} publicVars - 公共变量映射 {变量名: 值}
   */
  constructor(publicVars = {}) {
    this.publicVars = publicVars;
    this.functions = {
      // 逻辑函数
      IF: this._parseIf,
      AND: this._parseAnd,
      OR: this._parseOr,
      NOT: this._parseNot,
      XOR: this._parseXor,
      // 比较函数
      EQ: this._parseEq,
      NE: this._parseNe,
      GT: this._parseGt,
      GE: this._parseGe,
      LT: this._parseLt,
      LE: this._parseLe,
      // 数学函数
      ADD: this._parseAdd,
      SUB: this._parseSub,
      MUL: this._parseMul,
      DIV: this._parseDiv,
      MOD: this._parseMod,
      POW: this._parsePow,
      // 循环函数
      SUM: this._parseSum,
      PRODUCT: this._parseProduct,
      COUNT: this._parseCount,
      AVERAGE: this._parseAverage,
      MIN: this._parseMin,
      MAX: this._parseMax,
      // 日期函数
      DATE: this._parseDate,
      DATEDIFF: this._parseDateDiff,
      DAY: this._parseDay,
      MONTH: this._parseMonth,
      YEAR: this._parseYear,
      // 文本函数
      CONCAT: this._parseConcat,
      LEN: this._parseLen,
      LEFT: this._parseLeft,
      RIGHT: this._parseRight,
      // 数组函数
      MAP: this._parseMap,
      FILTER: this._parseFilter,
      REDUCE: this._parseReduce,
      ARRAY: this._parseArray
    };
  }
  /**
   * 解析Excel公式（直接返回计算结果）
   * @param {string} formula - Excel风格公式
   * @returns {*} 计算结果
   */
  parse(formula) {
    let jsCode = formula;
    const fieldPattern = /{([^{}]+)}/g;
    let match;
    while ((match = fieldPattern.exec(formula)) !== null) {
      const fieldName = match[1];
      if (!(fieldName in this.publicVars)) {
        throw new Error(`未定义变量: ${fieldName}`);
      }
      jsCode = jsCode.replace(new RegExp(`{${fieldName}}`, "g"), `this.publicVars['${fieldName}']`);
    }
    jsCode = this._parseFunctions(jsCode);
    console.log("jsCode :>> ", jsCode);
    try {
      const func = new Function(`
        "use strict";
        return ${jsCode};
      `).bind({ publicVars: this.publicVars });
      return func();
    } catch (error) {
      throw new Error(`公式执行错误: ${error.message}
公式: ${formula}`);
    }
  }
  /**
   * 添加或更新公共变量
   * @param {string} name - 变量名
   * @param {*} value - 变量值
   */
  setPublicVar(name, value) {
    this.publicVars[name] = value;
  }
  /**
   * 批量设置公共变量
   * @param {Object} vars - 变量对象 {变量名: 值}
   */
  setPublicVars(vars) {
    this.publicVars = { ...this.publicVars, ...vars };
  }
  // 私有方法 =======================================================
  /**
   * 提取公式中的字段名
   * @private
   */
  _extractFields(formula) {
    const fields2 = /* @__PURE__ */ new Set();
    const pattern = /{([^{}]+)}/g;
    let match;
    while ((match = pattern.exec(formula)) !== null) {
      fields2.add(match[1]);
    }
    return Array.from(fields2);
  }
  /**
   * 递归解析函数调用（支持多层嵌套）
   * @private
   */
  _parseFunctions(expression) {
    const funcNames = Object.keys(this.functions).sort((a, b) => b.length - a.length);
    let output = "";
    let index = 0;
    const n = expression.length;
    while (index < n) {
      let found = false;
      for (const funcName of funcNames) {
        if (expression.startsWith(funcName, index)) {
          const prevChar = index > 0 ? expression[index - 1] : "";
          const nextCharIndex = index + funcName.length;
          const nextChar = nextCharIndex < n ? expression[nextCharIndex] : "";
          if (!/[A-Za-z0-9_]/.test(prevChar) && // 确保不是子字符串
          (nextChar === "(" || /[\s]/.test(nextChar))) {
            let parenIndex = nextCharIndex;
            while (parenIndex < n && expression[parenIndex] === " ") {
              parenIndex++;
            }
            if (parenIndex < n && expression[parenIndex] === "(") {
              found = true;
              const [argsStr, newIndex] = this._extractArguments(expression, parenIndex);
              const parsedArgs = this._parseArguments(argsStr).map((arg) => this._parseFunctions(arg.trim()));
              output += this.functions[funcName](parsedArgs);
              index = newIndex;
              break;
            }
          }
        }
      }
      if (!found) {
        output += expression[index];
        index++;
      }
    }
    return output;
  }
  /**
   * 提取函数参数（带括号匹配）
   * @private
   */
  _extractArguments(expression, startIndex) {
    let depth = 1;
    let i = startIndex + 1;
    const n = expression.length;
    while (i < n && depth > 0) {
      switch (expression[i]) {
        case "(":
          depth++;
          break;
        case ")":
          depth--;
          break;
        case '"':
          i++;
          while (i < n && expression[i] !== '"') {
            if (expression[i] === "\\")
              i++;
            i++;
          }
          break;
      }
      i++;
    }
    if (depth !== 0) {
      throw new Error(`括号不匹配: ${expression.substring(startIndex)}`);
    }
    return [expression.substring(startIndex + 1, i - 1), i];
  }
  /**
   * 解析函数参数
   * @private
   */
  _parseArguments(argsStr) {
    const args = [];
    let current = "";
    let depth = 0;
    for (let i = 0; i < argsStr.length; i++) {
      const char = argsStr[i];
      if (char === "(")
        depth++;
      if (char === ")")
        depth--;
      if (char === "," && depth === 0) {
        args.push(current);
        current = "";
      } else {
        current += char;
      }
    }
    if (current)
      args.push(current);
    return args;
  }
  // 函数解析器实现 =================================================
  // 逻辑函数
  _parseIf(args) {
    return `(${args[0]} ? ${args[1]} : ${args[2]})`;
  }
  _parseAnd(args) {
    return `(${args.join(" && ")})`;
  }
  _parseOr(args) {
    return `(${args.join(" || ")})`;
  }
  _parseNot(args) {
    return `(!${args[0]})`;
  }
  _parseXor(args) {
    return `((${args[0]} && !${args[1]}) || (!${args[0]} && ${args[1]}))`;
  }
  // 比较函数
  _parseEq(args) {
    return `(${args[0]} === ${args[1]})`;
  }
  _parseNe(args) {
    return `(${args[0]} !== ${args[1]})`;
  }
  _parseGt(args) {
    return `(${args[0]} > ${args[1]})`;
  }
  _parseGe(args) {
    return `(${args[0]} >= ${args[1]})`;
  }
  _parseLt(args) {
    return `(${args[0]} < ${args[1]})`;
  }
  _parseLe(args) {
    return `(${args[0]} <= ${args[1]})`;
  }
  // 数学函数
  _parseAdd(args) {
    return `(${args.join(" + ")})`;
  }
  _parseSub(args) {
    return `(${args.join(" - ")})`;
  }
  _parseMul(args) {
    return `(${args.join(" * ")})`;
  }
  _parseDiv(args) {
    return `(${args[0]} / ${args[1]})`;
  }
  _parseMod(args) {
    return `(${args[0]} % ${args[1]})`;
  }
  _parsePow(args) {
    return `(Math.pow(${args[0]}, ${args[1]}))`;
  }
  // 循环函数
  _parseSum(args) {
    if (args.length === 1) {
      return `(Array.isArray(${args[0]}) ? 
            ${args[0]}.reduce((a, b) => a + b, 0) : 
            ${args[0]})`;
    } else {
      return `([${args.join(",")}].reduce((a, b) => a + b, 0))`;
    }
  }
  _parseProduct(args) {
    if (args.length === 1) {
      return `(Array.isArray(${args[0]}) ? 
            ${args[0]}.reduce((a, b) => a * b, 1) : 
            ${args[0]})`;
    } else {
      return `([${args.join(",")}].reduce((a, b) => a * b, 1))`;
    }
  }
  _parseCount(args) {
    return `([${args.join(",")}].length)`;
  }
  _parseAverage(args) {
    if (args.length === 1) {
      return `(() => {
      const arr = Array.isArray(${args[0]}) ? 
                 ${args[0]} : 
                 [${args[0]}];
      return arr.reduce((a, b) => a + b, 0) / arr.length;
    })()`;
    } else {
      return `(() => {
      const arr = [${args.join(",")}];
      return arr.reduce((a, b) => a + b, 0) / arr.length;
    })()`;
    }
  }
  _parseMin(args) {
    return `(Math.min(...[${args.join(",")}]))`;
  }
  _parseMax(args) {
    return `(Math.max(...[${args.join(",")}]))`;
  }
  // 日期函数
  _parseDate(args) {
    return `(new Date(${args[0]}, ${args[1]}-1, ${args[2]}))`;
  }
  // 修复后的日期差函数
  _parseDateDiff(args) {
    return `(() => {
      const parseDate = (val) => {
        if (val instanceof Date) return val;
        if (typeof val === 'string' || typeof val === 'number') return new Date(val);
        throw new Error('无效日期值: ' + val);
      };
      
      const start = parseDate(${args[0]});
      const end = parseDate(${args[1]});
      
      if (isNaN(start)) throw new Error('开始日期无效');
      if (isNaN(end)) throw new Error('结束日期无效');

      return Math.floor((end - start) / (1000 * 60 * 60 * 24));
    })()`;
  }
  _parseDay(args) {
    return `(new Date(${args[0]}).getDate())`;
  }
  _parseMonth(args) {
    return `(new Date(${args[0]}).getMonth() + 1)`;
  }
  _parseYear(args) {
    return `(new Date(${args[0]}).getFullYear())`;
  }
  // 文本函数
  _parseConcat(args) {
    return `([${args.join(",")}].join(''))`;
  }
  _parseLen(args) {
    return `(String(${args[0]}).length)`;
  }
  _parseLeft(args) {
    return `(String(${args[0]}).substring(0, ${args[1]}))`;
  }
  _parseRight(args) {
    return `(() => { const str = String(${args[0]}); return str.substring(str.length - ${args[1]})) })()`;
  }
  /**
   * 改进的MAP函数解析
   */
  _parseMap(args) {
    return `(${args[0]}.map(${args[1]}))`;
  }
  /**
   * 改进的FILTER函数解析
   */
  _parseFilter(args) {
    if (args.length !== 2) {
      throw new Error(`FILTER函数需要2个参数，但收到了${args.length}个`);
    }
    if (args[1].includes("=>")) {
      return `(${args[0]}.filter(${args[1]}))`;
    } else {
      return `(${args[0]}.filter(item => ${args[1]}))`;
    }
  }
  _parseReduce(args) {
    return `([${args[0]}].reduce((${args[1]}, ${args[2]}) => ${args[3]}, ${args[4] || "0"}))`;
  }
  /**
   * 改进的ARRAY函数解析
   */
  _parseArray(args) {
    if (args.length === 1) {
      return `Array.from({length: ${args[0]}}, (_, i) => i)`;
    } else if (args.length === 2 && args[1].includes("=>")) {
      return `Array.from({length: ${args[0]}}, ${args[1]})`;
    } else if (args.length === 2) {
      return `Array.from({length: ${args[1]} - ${args[0]} + 1}, (_, i) => ${args[0]} + i)`;
    } else if (args.length === 3) {
      return `(() => {
        const result = [];
        for (let i = ${args[0]}; i <= ${args[1]}; i += ${args[2]}) {
          result.push(i);
        }
        return result;
      })()`;
    }
    throw new Error(`无效的ARRAY参数: ${args.join(", ")}`);
  }
}
const ExcelFields = ["input", "number", "textarea", "date", "select", "computedays", "amount"];
function hasEmptyValue(obj) {
  return Object.values(obj).some((value) => {
    if (value == null)
      return true;
    if (typeof value === "string") {
      return value.trim() === "";
    }
    return false;
  });
}
class ExcelFormulaParserService {
  /**
   * 构造函数
   * @param {Object} config - 配置信息
   */
  constructor(config) {
    const copypublicVars = JSON.parse(JSON.stringify(config.publicVars));
    strTofunc(copypublicVars);
    this.parser = new ExcelFormulaParser(copypublicVars);
    this.formula = config.formula;
  }
  /**
   * 计算并返回结果
   */
  parse(widgetList, formData) {
    if (Array.isArray(widgetList)) {
      const widget = widgetList.filter((x) => ExcelFields.includes(x.type)).map((x) => {
        return {
          label: "DATA." + x.options.label,
          value: x.options.name
        };
      });
      const fieldVars = widget.filter((x) => this.formula.includes(x.label)).reduce((obj, item) => {
        obj[item.label] = formData[item.value];
        return obj;
      }, {});
      this.parser.setPublicVars(fieldVars);
      if (!hasEmptyValue(fieldVars)) {
        return this.parser.parse(this.formula);
      }
    }
    return "";
  }
}
const strTofunc = (publicVars) => {
  for (const key in publicVars) {
    if (Object.prototype.hasOwnProperty.call(publicVars, key)) {
      const value = publicVars[key];
      if (typeof value === "function") {
        continue;
      }
      if (typeof value === "string") {
        const trimmedValue = value.trim();
        const isArrowFunction = trimmedValue.startsWith("(") && trimmedValue.includes("=>");
        const isTraditionalFunction = trimmedValue.startsWith("function") || trimmedValue.startsWith("async function");
        if (isArrowFunction || isTraditionalFunction) {
          try {
            publicVars[key] = new Function(`return (${trimmedValue})`)();
          } catch (e) {
            console.error(`函数转换失败 (${key}):`, e);
          }
        }
        continue;
      }
    }
  }
};
const FastCodes = [
  /** 请假组件-退餐统计 */
  `SUM(
  MAP(
    FILTER(
      ARRAY(DATEDIFF({DATA.开始时间}, {DATA.结束时间}) + 1, 
        (_, i) => DATE(
          YEAR({DATA.开始时间}),
          MONTH({DATA.开始时间}),
          DAY({DATA.开始时间}) + i
        )
      ),
      date => {是否为工作日}(date)
    ),
    date => SUM(
      IF(
        {应退早餐}(date, new Date({DATA.开始时间}), new Date({DATA.结束时间}),{早餐时段}),
        {早餐价格}, 
        0
      ),
      IF(
        {应退午餐}(date, new Date({DATA.开始时间}), new Date({DATA.结束时间}),{午餐时段}),
        {午餐价格}, 
        0
      ),
      IF(
        {应退晚餐}(date, new Date({DATA.开始时间}), new Date({DATA.结束时间}),{晚餐时段}),
        {晚餐价格}, 
        0
      )
    )
  )
)`
];
const FastPublicVars = [
  {
    // 餐段配置
    早餐时段: ["7:00", "9:00"],
    午餐时段: ["11:00", "12:30"],
    晚餐时段: ["17:00", "19:00"],
    早餐价格: 5,
    午餐价格: 10,
    晚餐价格: 15,
    // 是否为工作日
    是否为工作日: `(date) => {
        const day = date.getDay()
        return day !== 0 && day !== 6 // 0=周日, 6=周六
      }`,
    // 餐段退款判断函数
    应退早餐: `(mealDate, startDate, endDate, period) => {
        // 解析餐段时间
        const parseTime = (time) => {
          if (typeof time === 'string') {
            const [hours, minutes] = time.split(':').map(Number)
            return { hours, minutes }
          }
          return time
        }
        const startTime = parseTime(period[0])
        const endTime = parseTime(period[1])

        // 早餐时段开始时间
        const mealStart = new Date(mealDate)
        mealStart.setHours(startTime.hours, startTime.minutes, 0, 0)

        // 早餐时段结束时间
        const mealEnd = new Date(mealDate)
        mealEnd.setHours(endTime.hours, endTime.minutes, 0, 0)

        // 检查是否为同一天
        const isSameDay = (d1, d2) =>
          d1.getFullYear() === d2.getFullYear() &&
          d1.getMonth() === d2.getMonth() &&
          d1.getDate() === d2.getDate()

        // 如果是开始日，检查请假开始时间是否在早餐时段之后
        if (isSameDay(mealDate, startDate)) {
          return startDate <= mealStart
        }

        // 如果是结束日，检查请假结束时间是否在早餐时段之前
        if (isSameDay(mealDate, endDate)) {
          return endDate >= mealEnd
        }

        // 中间日全额退款
        return true
      }`,
    应退午餐: `(mealDate, startDate, endDate, period) => {
        const parseTime = (time) => {
          if (typeof time === 'string') {
            const [hours, minutes] = time.split(':').map(Number)
            return { hours, minutes }
          }
          return time
        }

        const startTime = parseTime(period[0])
        const endTime = parseTime(period[1])

        const mealStart = new Date(mealDate)
        mealStart.setHours(startTime.hours, startTime.minutes, 0, 0)

        const mealEnd = new Date(mealDate)
        mealEnd.setHours(endTime.hours, endTime.minutes, 0, 0)

        const isSameDay = (d1, d2) =>
          d1.getFullYear() === d2.getFullYear() &&
          d1.getMonth() === d2.getMonth() &&
          d1.getDate() === d2.getDate()

        if (isSameDay(mealDate, startDate)) {
          return startDate <= mealStart
        }

        if (isSameDay(mealDate, endDate)) {
          return endDate >= mealEnd
        }

        return true
      }`,
    应退晚餐: `(mealDate, startDate, endDate, period) => {
        const parseTime = (time) => {
          if (typeof time === 'string') {
            const [hours, minutes] = time.split(':').map(Number)
            return { hours, minutes }
          }
          return time
        }

        const startTime = parseTime(period[0])
        const endTime = parseTime(period[1])

        const mealStart = new Date(mealDate)
        mealStart.setHours(startTime.hours, startTime.minutes, 0, 0)

        const mealEnd = new Date(mealDate)
        mealEnd.setHours(endTime.hours, endTime.minutes, 0, 0)

        const isSameDay = (d1, d2) =>
          d1.getFullYear() === d2.getFullYear() &&
          d1.getMonth() === d2.getMonth() &&
          d1.getDate() === d2.getDate()

        if (isSameDay(mealDate, startDate)) {
          return startDate <= mealStart
        }

        if (isSameDay(mealDate, endDate)) {
          return endDate >= mealEnd
        }

        return true
      }`
  }
];
const _hoisted_1$A = { style: { "color": "#606266", "line-height": "2", "padding-right": "12px" } };
const _hoisted_2$o = ["onMouseover"];
const _hoisted_3$g = ["innerHTML"];
const _hoisted_4$c = {
  key: 1,
  style: { "display": "flex", "flex-wrap": "wrap" }
};
const _hoisted_5$a = { class: "dialog-footer" };
const _sfc_main$P = {
  __name: "input-option",
  props: propsDefinition,
  setup(__props) {
    const props2 = __props;
    const { selected, fieldConfig, formConfig, widgetList } = toRefs(props2);
    const editorRef = ref$1(null);
    const dialogCode = ref$1(false);
    const formulaCode = ref$1("");
    const formulaVars = ref$1(null);
    const selectedFunKey = ref$1(null);
    const tipRedmer = computed(() => functions[selectedFunKey.value] || "");
    const functionsList = ref$1([
      {
        label: "逻辑函数",
        children: [
          {
            label: "布尔",
            value: "IF",
            type: "warning"
          },
          {
            label: "布尔",
            value: "AND",
            type: "warning"
          },
          {
            label: "布尔",
            value: "OR",
            type: "warning"
          },
          {
            label: "布尔",
            value: "NOT",
            type: "warning"
          },
          {
            label: "布尔",
            value: "XOR",
            type: "warning"
          }
        ]
      },
      {
        label: "比较函数",
        children: [
          {
            label: "布尔",
            value: "EQ",
            type: "warning"
          },
          {
            label: "布尔",
            value: "NE",
            type: "warning"
          },
          {
            label: "布尔",
            value: "GT",
            type: "warning"
          },
          {
            label: "布尔",
            value: "GE",
            type: "warning"
          },
          {
            label: "布尔",
            value: "LT",
            type: "warning"
          },
          {
            label: "布尔",
            value: "LE",
            type: "warning"
          }
        ]
      },
      {
        label: "数学函数",
        children: [
          {
            label: "数字",
            value: "ADD",
            type: "primary"
          },
          {
            label: "数字",
            value: "SUB",
            type: "primary"
          },
          {
            label: "数字",
            value: "MUL",
            type: "primary"
          },
          {
            label: "数字",
            value: "DIV",
            type: "primary"
          },
          {
            label: "数字",
            value: "MOD",
            type: "primary"
          },
          {
            label: "数字",
            value: "POW",
            type: "primary"
          }
        ]
      },
      {
        label: "循环函数",
        children: [
          {
            label: "数字",
            value: "SUM",
            type: "primary"
          },
          {
            label: "数字",
            value: "PRODUCT",
            type: "primary"
          },
          {
            label: "数字",
            value: "COUNT",
            type: "primary"
          },
          {
            label: "数字",
            value: "AVERAGE",
            type: "primary"
          },
          {
            label: "数字",
            value: "MIN",
            type: "primary"
          },
          {
            label: "数字",
            value: "MAX",
            type: "primary"
          }
        ]
      },
      {
        label: "日期函数",
        children: [
          {
            label: "日期",
            value: "DATE",
            type: "success"
          },
          {
            label: "数字",
            value: "DATEDIFF",
            type: "primary"
          },
          {
            label: "数字",
            value: "DAY",
            type: "primary"
          },
          {
            label: "数字",
            value: "MONTH",
            type: "primary"
          },
          {
            label: "数字",
            value: "YEAR",
            type: "primary"
          }
        ]
      },
      {
        label: "文本函数",
        children: [
          {
            label: "文本",
            value: "CONCAT",
            type: "warning"
          },
          {
            label: "数字",
            value: "LEN",
            type: "primary"
          },
          {
            label: "文本",
            value: "LEFT",
            type: "warning"
          },
          {
            label: "文本",
            value: "RIGHT",
            type: "warning"
          }
        ]
      },
      {
        label: "数组函数",
        children: [
          {
            label: "数组",
            value: "MAP",
            type: "danger"
          },
          {
            label: "数组",
            value: "FILTER",
            type: "danger"
          },
          {
            label: "数字",
            value: "REDUCE",
            type: "primary"
          },
          {
            label: "数字",
            value: "ARRAY",
            type: "primary"
          }
        ]
      }
    ]);
    const functions = {
      IF: `<font color="#930f80">IF</font>函数用于条件判断，如果满足条件则返回一个值，如果不满足，则返回另外一个值。<br>
  语法：<font color="#930f80">IF</font>(逻辑测试, 值如果为真, 值如果为假)<br>
  例如：<font color="#930f80">IF</font>(A1>10, "大于10", "小于等于10")<br>
  其中A1是要测试的条件，如果A1的值大于10，则返回"大于10"，否则返回"小于等于10"。<br>
  也可以嵌套使用多个<font color="#930f80">IF</font>函数来处理更复杂的条件判断。
`,
      AND: `<font color="#930f80">AND</font>函数用于判断多个条件是否同时满足，如果所有条件都为真，则返回真，否则返回假。<br>
  语法：<font color="#930f80">AND</font>(逻辑1, [逻辑2], ...)<br>
  例如：<font color="#930f80">AND</font>(A1>10, B1<20)<br>
  其中A1和B1是要测试的条件，如果A1大于10且B1小于20，则返回真，否则返回假。<br>
  <font color="#930f80">AND</font>函数可以与<font color="#930f80">IF</font>函数结合使用来进行更复杂的条件判断。`,
      OR: `<font color="#930f80">OR</font>函数用于判断多个条件中是否至少有一个满足，如果至少有一个条件为真，则返回真，否则返回假。<br>
  语法：<font color="#930f80">OR</font>(逻辑1, [逻辑2], ...)<br>
  例如：<font color="#930f80">OR</font>(A1>10, B1<20)<br>
  其中A1和B1是要测试的条件，如果A1大于10或B1小于20，则返回真，否则返回假。<br>
  <font color="#930f80">OR</font>函数可以与<font color="#930f80">IF</font>函数结合使用来进行更复杂的条件判断。`,
      NOT: `<font color="#930f80">NOT</font>函数用于对逻辑值取反，如果逻辑值为真，则返回假；如果逻辑值为假，则返回真。<br>
  语法：<font color="#930f80">NOT</font>(逻辑)<br>
  例如：<font color="#930f80">NOT</font>(A1>10)<br>
  其中A1是要测试的条件，如果A1大于10，则<font color="#930f80">NOT</font>函数返回假，否则返回真。<br>
  <font color="#930f80">NOT</font>函数可以与<font color="#930f80">IF</font>函数结合使用来进行更复杂的条件判断。`,
      XOR: `<font color="#930f80">XOR</font>函数用于判断多个条件中是否有奇数个条件为真，如果奇数个条件为真，则返回真，否则返回假。<br>
  语法：<font color="#930f80">XOR</font>(逻辑1, [逻辑2], ...)<br>
  例如：<font color="#930f80">XOR</font>(A1>10, B1<20)<br>
  其中A1和B1是要测试的条件，如果A1大于10且B1小于20的条件为奇数个，则返回真，否则返回假。<br>
  <font color="#930f80">XOR</font>函数可以与<font color="#930f80">IF</font>函数结合使用来进行更复杂的条件判断。`,
      EQ: `<font color="#930f80">EQ</font>函数用于判断两个值是否相等，如果相等则返回真，否则返回假。<br>
  语法：<font color="#930f80">EQ</font>(值1, 值2)<br>
  例如：<font color="#930f80">EQ</font>(A1, B1)<br>
  其中A1和B1是要比较的值，如果A1等于B1，则返回真，否则返回假。<br>
  <font color="#930f80">EQ</font>函数可以与<font color="#930f80">IF</font>函数结合使用来进行更复杂的条件判断。`,
      NE: `<font color="#930f80">NE</font>函数用于判断两个值是否不相等，如果不相等则返回真，否则返回假。<br>
  语法：<font color="#930f80">NE</font>(值1, 值2)<br>
  例如：<font color="#930f80">NE</font>(A1, B1)<br>
  其中A1和B1是要比较的值，如果A1不等于B1，则返回真，否则返回假。<br>
  <font color="#930f80">NE</font>函数可以与<font color="#930f80">IF</font>函数结合使用来进行更复杂的条件判断。`,
      GT: `<font color="#930f80">GT</font>函数用于判断第一个值是否大于第二个值，如果大于则返回真，否则返回假。<br>
  语法：<font color="#930f80">GT</font>(值1, 值2)<br>
  例如：<font color="#930f80">GT</font>(A1, B1)<br>
  其中A1和B1是要比较的值，如果A1大于B1，则返回真，否则返回假。<br>
  <font color="#930f80">GT</font>函数可以与<font color="#930f80">IF</font>函数结合使用来进行更复杂的条件判断。`,
      GE: `<font color="#930f80">GE</font>函数用于判断第一个值是否大于或等于第二个值，如果大于或等于则返回真，否则返回假。<br>
  语法：<font color="#930f80">GE</font>(值1, 值2)<br>
  例如：<font color="#930f80">GE</font>(A1, B1)<br>
  其中A1和B1是要比较的值，如果A1大于或等于B1，则返回真，否则返回假。<br>
  <font color="#930f80">GE</font>函数可以与<font color="#930f80">IF</font>函数结合使用来进行更复杂的条件判断。`,
      LT: `<font color="#930f80">LT</font>函数用于判断第一个值是否小于第二个值，如果小于则返回真，否则返回假。<br>
  语法：<font color="#930f80">LT</font>(值1, 值2)<br>
  例如：<font color="#930f80">LT</font>(A1, B1)<br>
  其中A1和B1是要比较的值，如果A1小于B1，则返回真，否则返回假。<br>
  <font color="#930f80">LT</font>函数可以与<font color="#930f80">IF</font>函数结合使用来进行更复杂的条件判断。`,
      LE: `<font color="#930f80">LE</font>函数用于判断第一个值是否小于或等于第二个值，如果小于或等于则返回真，否则返回假。<br>
  语法：<font color="#930f80">LE</font>(值1, 值2)<br>
  例如：<font color="#930f80">LE</font>(A1, B1)<br>
  其中A1和B1是要比较的值，如果A1小于或等于B1，则返回真，否则返回假。<br>
  <font color="#930f80">LE</font>函数可以与<font color="#930f80">IF</font>函数结合使用来进行更复杂的条件判断。`,
      ADD: `<font color="#930f80">ADD</font>函数用于对两个数值进行加法运算。<br>
  语法：<font color="#930f80">ADD</font>(数字1, 数字2)<br>
  例如：<font color="#930f80">ADD</font>(10, 20) 返回 30<br>
  其中数字1和数字2是要相加的数值。<br>`,
      SUB: `<font color="#930f80">SUB</font>函数用于对两个数值进行减法运算。<br>
  语法：<font color="#930f80">SUB</font>(数字1, 数字2)<br>
  例如：<font color="#930f80">SUB</font>(20, 10) 返回 10<br>
  其中数字1是被减数，数字2是减数。<br>`,
      MUL: `<font color="#930f80">MUL</font>函数用于对两个数值进行乘法运算。<br>
  语法：<font color="#930f80">MUL</font>(数字1, 数字2)<br>
  例如：<font color="#930f80">MUL</font>(10, 20) 返回 200<br>
  其中数字1和数字2是要相乘的数值。<br>`,
      DIV: `<font color="#930f80">DIV</font>函数用于对两个数值进行除法运算。<br>
  语法：<font color="#930f80">DIV</font>(数字1, 数字2)<br>
  例如：<font color="#930f80">DIV</font>(20, 10) 返回 2<br>
  其中数字1是被除数，数字2是除数。<br>`,
      MOD: `<font color="#930f80">MOD</font>函数用于对两个数值进行取模运算。<br>
  语法：<font color="#930f80">MOD</font>(数字1, 数字2)<br>
  例如：<font color="#930f80">MOD</font>(20, 3) 返回 2<br>
  其中数字1是被除数，数字2是除数。<br>`,
      POW: `<font color="#930f80">POW</font>函数用于对一个数值进行幂运算。<br>
  语法：<font color="#930f80">POW</font>(数字, 指数)<br>
  例如：<font color="#930f80">POW</font>(2, 3) 返回 8<br>
  其中数字是底数，指数是幂的指数。<br>`,
      SUM: `<font color="#930f80">SUM</font>函数可以对一组数值进行求和<br>
  语法：<font color="#930f80">SUM</font>(数字1, 数字2, ...) 或<br>
  <font color="#930f80">SUM</font>([数字1, 数字2, ...]) <br>
  其中数字1, 数字2, ... 是要相加的数值。<br>
  例如：<font color="#930f80">SUM</font>(10, 20, 30) 返回 60<br>`,
      PRODUCT: `<font color="#930f80">PRODUCT</font>函数可以对一组数值进行乘积计算<br>
  语法：<font color="#930f80">PRODUCT</font>(数字1, 数字2, ...) 或<br>
  <font color="#930f80">PRODUCT</font>([数字1, 数字2, ...]) <br>
  其中数字1, 数字2, ... 是要相乘的数值。<br>
  例如：<font color="#930f80">PRODUCT</font>(2, 3, 4) 返回 24<br>`,
      COUNT: `<font color="#930f80">COUNT</font>函数可以计算一组数值中的非空单元格数量<br>
  语法：<font color="#930f80">COUNT</font>(数字1, 数字2, ...) 或<br>
  <font color="#930f80">COUNT</font>([数字1, 数字2, ...]) <br>
  其中数字1, 数字2, ... 是要计算的数值。<br>
  例如：<font color="#930f80">COUNT</font>(10, 20, 30) 返回 3<br>`,
      AVERAGE: `<font color="#930f80">AVERAGE</font>函数可以获取一组数值的算术平均值<br>
  语法：<font color="#930f80">AVERAGE</font>(数字1, 数字2, ...) 或<br>
  <font color="#930f80">AVERAGE</font>([数字1, 数字2, ...]) <br>
  其中数字1, 数字2, ... 是要计算平均值的数值。<br>
  例如：<font color="#930f80">AVERAGE</font>(10, 20, 30) 返回 20<br
  `,
      MIN: `<font color="#930f80">MIN</font>函数可以获取一组数值中的最小值<br>
  语法：<font color="#930f80">MIN</font>(数字1, 数字2, ...) 或<br>
  <font color="#930f80">MIN</font>([数字1, 数字2, ...]) <br>
  其中数字1, 数字2, ... 是要计算最小值的数值。<br>
  例如：<font color="#930f80">MIN</font>(10, 20, 30) 返回 10<br>
  `,
      MAX: `<font color="#930f80">MAX</font>函数可以获取一组数值中的最大值<br>
  语法：<font color="#930f80">MAX</font>(数字1, 数字2, ...) 或<br>
  <font color="#930f80">MAX</font>([数字1, 数字2, ...]) <br>
  其中数字1, 数字2, ... 是要计算最大值的数值。<br>
  例如：<font color="#930f80">MAX</font>(10, 20, 30) 返回 30<br>
  `,
      DATE: `<font color="#930f80">DATE</font>函数用于创建一个日期值。<br>
  语法：<font color="#930f80">DATE</font>(年, 月, 日)<br>
  例如：<font color="#930f80">DATE</font>(2023, 10, 1) 返回 2023年10月1日的日期值。<br>
  其中年、月、日分别表示年份、月份和日期。<br>`,
      DATEDIFF: `<font color="#930f80">DATEDIFF</font>函数用于计算两个日期之间的差值。<br>
  语法：<font color="#930f80">DATEDIFF</font>(日期1, 日期2)<br>
  例如：<font color="#930f80">DATEDIFF</font>(DATE(2023, 10, 1), DATE(2023, 9, 1)) 返回 30，表示两个日期之间相差30天。<br>
  其中日期1和日期2分别表示要计算差值的两个日期。<br>`,
      DAY: `<font color="#930f80">DAY</font>函数用于获取日期中的天数部分。<br>
  语法：<font color="#930f80">DAY</font>(日期)<br>
  例如：<font color="#930f80">DAY</font>(DATE(2023, 10, 1)) 返回 1，表示2023年10月1日的天数部分。<br>
  其中日期表示要获取天数的日期值。<br>`,
      MONTH: `<font color="#930f80">MONTH</font>函数用于获取日期中的月份部分。<br>
  语法：<font color="#930f80">MONTH</font>(日期)<br>
  例如：<font color="#930f80">MONTH</font>(DATE(2023, 10, 1)) 返回 10，表示2023年10月的月份部分。<br>
  其中日期表示要获取月份的日期值。<br>`,
      YEAR: `<font color="#930f80">YEAR</font>函数用于获取日期中的年份部分。<br>
  语法：<font color="#930f80">YEAR</font>(日期)<br>
  例如：<font color="#930f80">YEAR</font>(DATE(2023, 10, 1)) 返回 2023，表示2023年的年份部分。<br>
  其中日期表示要获取年份的日期值。<br>`,
      CONCAT: `<font color="#930f80">CONCAT</font>函数用于连接多个文本字符串。<br>
  语法：<font color="#930f80">CONCAT</font>(文本1, 文本2, ...) 或<br>
  <font color="#930f80">CONCAT</font>([文本1, 文本2, ...]) <br>
  例如：<font color="#930f80">CONCAT</font>("Hello", " ", "World") 返回 "Hello World"<br>
  其中文本1, 文本2, ... 是要连接的文本字符串。<br>`,
      LEN: `<font color="#930f80">LEN</font>函数用于获取文本字符串的长度。<br>
  语法：<font color="#930f80">LEN</font>(文本)<br>
  例如：<font color="#930f80">LEN</font>("Hello World") 返回 11，表示字符串 "Hello World" 的长度为11个字符。<br>
  其中文本表示要获取长度的文本字符串。<br>`,
      LEFT: `<font color="#930f80">LEFT</font>函数用于获取文本字符串的左侧指定数量的字符。<br>
  语法：<font color="#930f80">LEFT</font>(文本, num_chars)<br>
  例如：<font color="#930f80">LEFT</font>("Hello World", 5) 返回 "Hello"，表示获取字符串 "Hello World" 的左侧5个字符。<br>
  其中文本表示要处理的文本字符串，num_chars表示要获取的字符数量。<br>`,
      RIGHT: `<font color="#930f80">RIGHT</font>函数用于获取文本字符串的右侧指定数量的字符。<br>
  语法：<font color="#930f80">RIGHT</font>(文本, num_chars)<br>
  例如：<font color="#930f80">RIGHT</font>("Hello World", 5) 返回 "World"，表示获取字符串 "Hello World" 的右侧5个字符。<br>
  其中文本表示要处理的文本字符串，num_chars表示要获取的字符数量。<br>`,
      MAP: `<font color="#930f80">MAP</font>函数用于对数组中的每个元素应用一个函数，并返回一个新的数组。<br>
  语法：<font color="#930f80">MAP</font>(array, lambda)<br>
  例如：<font color="#930f80">MAP</font>([1, 2, 3], x => x * 2) 返回 [2, 4, 6]，表示对数组中的每个元素乘以2。<br>
  其中array是要处理的数组，lambda是应用于每个元素的函数。<br>`,
      FILTER: `<font color="#930f80">FILTER</font>函数用于从数组中筛选出满足条件的元素，并返回一个新的数组。<br>
  语法：<font color="#930f80">FILTER</font>(array, lambda)<br>
  例如：<font color="#930f80">FILTER</font>([1, 2, 3, 4], x => x > 2) 返回 [3, 4]，表示筛选出大于2的元素。<br>
  其中array是要处理的数组，lambda是筛选条件函数。<br>`,
      REDUCE: `<font color="#930f80">REDUCE</font>函数用于对数组中的元素进行累积计算，并返回一个单一的值。<br>
  语法：<font color="#930f80">REDUCE</font>(array, lambda, initialValue)<br>
  例如：<font color="#930f80">REDUCE</font>([1, 2, 3], (acc, x) => acc + x, 0) 返回 6，表示对数组中的元素进行求和。<br>
  其中array是要处理的数组，lambda是累积计算函数，initialValue是初始值。<br>`,
      ARRAY: `<font color="#930f80">ARRAY</font>函数用于创建一个数组。<br>
  语法：<font color="#930f80">ARRAY</font>(元素1, 元素2, ...) 或<br>
  <font color="#930f80">ARRAY</font>([元素1, 元素2, ...]) <br>
  例如：<font color="#930f80">ARRAY</font>(1, 2, 3) 返回 [1, 2, 3]，表示创建一个包含1、2、3的数组。<br>
  其中元素1, 元素2, ... 是要包含在数组中的元素。<br>`
    };
    const handleNodeMouseover = (data) => {
      const { value } = data;
      if (value) {
        selectedFunKey.value = value;
      }
    };
    const handleNodeClick = (data) => {
      const { value } = data;
      if (value) {
        editorRef.value.insertValue(value + "()");
        editorRef.value.focus(-1);
      } else {
        selectedFunKey.value = null;
      }
    };
    const handleNodeCollapse = () => {
      selectedFunKey.value = null;
    };
    function objToList(obj) {
      return Object.entries(obj).map(([key, value]) => {
        let type2 = "Object";
        if (typeof value === "number") {
          type2 = "Number";
        }
        if (typeof value === "string") {
          type2 = "String";
        }
        if (typeof value === "function") {
          type2 = "Function";
        }
        if (Array.isArray(value)) {
          type2 = "Array";
          try {
            value = JSON.stringify(value);
          } catch (e) {
          }
        }
        return {
          label: key,
          value: String(value),
          type: type2
        };
      });
    }
    const formFields = computed(() => {
      const arr = widgetList.value.filter((x) => ExcelFields.includes(x.type) && x.id !== selected.value.id).map((x) => {
        return {
          label: "DATA." + x.options.label,
          value: "表单组件",
          type: x.name
        };
      });
      const config = widgetList.value.find((x) => x.type === "card");
      if (config && Array.isArray(config.components)) {
        const names = config.components.filter((x) => ExcelFields.includes(x.type) && x.id !== selected.value.id).map((x) => {
          return {
            label: "DATA." + x.options.label,
            value: "表单组件",
            type: x.name
          };
        });
        arr.push(...names);
      }
      if (config && typeof config.options.publicVars === "object") {
        const copypublicVars = JSON.parse(JSON.stringify(config.options.publicVars));
        strTofunc(copypublicVars);
        arr.push(...objToList(copypublicVars));
      }
      if (formulaVars.value) {
        const copyformulaVars = JSON.parse(JSON.stringify(formulaVars.value));
        strTofunc(copyformulaVars);
        arr.push(...objToList(copyformulaVars));
      }
      return arr;
    });
    const handleSave = () => {
      fieldConfig.value.defaultValue = "";
      fieldConfig.value.defaultValueFunc = formulaCode.value;
      const config = widgetList.value.find((x) => x.type === "card");
      if (config && config.options.publicVars) {
        _.merge(config.options.publicVars, formulaVars.value || {});
      }
      dialogCode.value = false;
    };
    const handleInsertVar = (item) => {
      if (item.type === "Function") {
        const paramsMatch = item.value.match(/\(([^)]*)\)/);
        const paramsString = paramsMatch ? paramsMatch[0] : "()";
        editorRef.value.insertValue("{" + item.label + "}" + paramsString);
        editorRef.value.focus();
      } else {
        editorRef.value.insertValue("{" + item.label + "}");
        editorRef.value.focus();
      }
    };
    const showFastCodeLinks = computed(() => {
      const links = [];
      if (widgetList.value.find((x) => x.type === "card" && x.options.name === "leave")) {
        links.push(0);
      }
      return links;
    });
    const onFastCode = (n) => {
      editorRef.value.setValue(FastCodes[n]);
      formulaVars.value = FastPublicVars[n];
    };
    watch(dialogCode, (val) => {
      if (val) {
        selectedFunKey.value = null;
        formulaCode.value = fieldConfig.value.defaultValueFunc || "";
        formulaVars.value = null;
      }
    });
    const limitInput = () => {
      if (fieldConfig.value.maxlength > 20) {
        fieldConfig.value.maxlength = "20";
      }
      if (fieldConfig.value.maxlength < 1) {
        fieldConfig.value.maxlength = "1";
      }
    };
    return (_ctx, _cache) => {
      const _component_el_option = resolveComponent("el-option");
      const _component_el_select = resolveComponent("el-select");
      const _component_el_form_item = resolveComponent("el-form-item");
      const _component_el_input = resolveComponent("el-input");
      const _component_el_button = resolveComponent("el-button");
      const _component_el_switch = resolveComponent("el-switch");
      const _component_code_editor_formula = resolveComponent("code-editor-formula");
      const _component_el_card = resolveComponent("el-card");
      const _component_el_link = resolveComponent("el-link");
      const _component_el_tag = resolveComponent("el-tag");
      const _component_el_scrollbar = resolveComponent("el-scrollbar");
      const _component_el_col = resolveComponent("el-col");
      const _component_el_tree = resolveComponent("el-tree");
      const _component_el_row = resolveComponent("el-row");
      const _component_el_dialog = resolveComponent("el-dialog");
      return openBlock(), createElementBlock(Fragment, null, [
        createVNode(_sfc_main$R, {
          selected: unref(selected),
          "field-config": unref(fieldConfig),
          "form-config": unref(formConfig)
        }, {
          default: withCtx(({ hideOptions }) => [
            unref(fieldConfig).defaultValue !== void 0 && hideOptions("defaultValue") ? (openBlock(), createBlock(_component_el_form_item, {
              key: 0,
              label: "默认值"
            }, {
              default: withCtx(() => [
                createVNode(_component_el_select, {
                  modelValue: unref(fieldConfig).defaultValueType,
                  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(fieldConfig).defaultValueType = $event),
                  placeholder: ""
                }, {
                  default: withCtx(() => [
                    createVNode(_component_el_option, {
                      label: "自定义",
                      value: 0
                    }),
                    createVNode(_component_el_option, {
                      label: "公式编辑",
                      value: 1
                    })
                  ]),
                  _: 1
                }, 8, ["modelValue"])
              ]),
              _: 1
            })) : createCommentVNode("", true),
            unref(fieldConfig).defaultValueType === 0 ? (openBlock(), createBlock(_component_el_form_item, { key: 1 }, {
              default: withCtx(() => [
                createVNode(_component_el_input, {
                  modelValue: unref(fieldConfig).defaultValue,
                  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(fieldConfig).defaultValue = $event),
                  type: "textarea",
                  rows: 2,
                  maxlength: unref(fieldConfig).maxlength,
                  placeholder: "请输入默认值",
                  "show-word-limit": ""
                }, null, 8, ["modelValue", "maxlength"])
              ]),
              _: 1
            })) : createCommentVNode("", true),
            unref(fieldConfig).defaultValueType === 1 ? (openBlock(), createBlock(_component_el_form_item, { key: 2 }, {
              default: withCtx(() => [
                createVNode(_component_el_button, {
                  style: { "flex": "1" },
                  plain: "",
                  onClick: _cache[2] || (_cache[2] = ($event) => dialogCode.value = true)
                }, {
                  default: withCtx(() => _cache[10] || (_cache[10] = [
                    createTextVNode("编辑公式")
                  ])),
                  _: 1
                })
              ]),
              _: 1
            })) : createCommentVNode("", true),
            unref(fieldConfig).append !== void 0 && hideOptions("append") ? (openBlock(), createBlock(_component_el_form_item, {
              key: 3,
              label: "后置内容"
            }, {
              default: withCtx(() => [
                createVNode(_component_el_input, {
                  modelValue: unref(fieldConfig).append,
                  "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => unref(fieldConfig).append = $event),
                  maxlength: "3",
                  placeholder: "请输入后置显示文字"
                }, null, 8, ["modelValue"])
              ]),
              _: 1
            })) : createCommentVNode("", true),
            unref(fieldConfig).maxlength !== void 0 && hideOptions("maxlength") ? (openBlock(), createBlock(_component_el_form_item, {
              key: 4,
              label: "长度限制"
            }, {
              default: withCtx(() => [
                createVNode(_component_el_input, {
                  modelValue: unref(fieldConfig).maxlength,
                  "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => unref(fieldConfig).maxlength = $event),
                  type: "number",
                  min: "1",
                  max: "20",
                  placeholder: "最大字符长度",
                  onBlur: limitInput
                }, null, 8, ["modelValue"])
              ]),
              _: 1
            })) : createCommentVNode("", true),
            unref(fieldConfig).showWordLimit !== void 0 && hideOptions("showWordLimit") ? (openBlock(), createBlock(_component_el_form_item, {
              key: 5,
              label: "显示计数器"
            }, {
              default: withCtx(() => [
                createVNode(_component_el_switch, {
                  modelValue: unref(fieldConfig).showWordLimit,
                  "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => unref(fieldConfig).showWordLimit = $event),
                  size: "default"
                }, null, 8, ["modelValue"])
              ]),
              _: 1
            })) : createCommentVNode("", true)
          ]),
          _: 1
        }, 8, ["selected", "field-config", "form-config"]),
        createVNode(_component_el_dialog, {
          modelValue: dialogCode.value,
          "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => dialogCode.value = $event),
          title: "公式编辑",
          "close-on-click-modal": false,
          "close-on-press-escape": false,
          "destroy-on-close": ""
        }, {
          footer: withCtx(() => [
            createElementVNode("span", _hoisted_5$a, [
              createVNode(_component_el_button, {
                type: "primary",
                onClick: handleSave
              }, {
                default: withCtx(() => _cache[15] || (_cache[15] = [
                  createTextVNode("确定")
                ])),
                _: 1
              }),
              createVNode(_component_el_button, {
                onClick: _cache[8] || (_cache[8] = ($event) => dialogCode.value = false)
              }, {
                default: withCtx(() => _cache[16] || (_cache[16] = [
                  createTextVNode("关闭")
                ])),
                _: 1
              })
            ])
          ]),
          default: withCtx(() => [
            createVNode(_component_el_card, { shadow: "never" }, {
              default: withCtx(() => [
                createVNode(_component_code_editor_formula, {
                  ref_key: "editorRef",
                  ref: editorRef,
                  modelValue: formulaCode.value,
                  "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => formulaCode.value = $event)
                }, null, 8, ["modelValue"])
              ]),
              _: 1
            }),
            createVNode(_component_el_row, {
              gutter: 20,
              style: { "margin-top": "20px", "height": "230px" }
            }, {
              default: withCtx(() => [
                createVNode(_component_el_col, { span: 7 }, {
                  default: withCtx(() => [
                    createVNode(_component_el_card, {
                      shadow: "never",
                      "body-style": { "padding-right": "0px" }
                    }, {
                      header: withCtx(() => _cache[11] || (_cache[11] = [
                        createElementVNode("div", { class: "card-header" }, [
                          createElementVNode("span", { style: { "font-size": "12px" } }, "当前表单字段与公共变量")
                        ], -1)
                      ])),
                      default: withCtx(() => [
                        createVNode(_component_el_scrollbar, { height: "170px" }, {
                          default: withCtx(() => [
                            createElementVNode("ul", _hoisted_1$A, [
                              (openBlock(true), createElementBlock(Fragment, null, renderList(formFields.value, (item, i) => {
                                return openBlock(), createElementBlock("li", {
                                  key: i,
                                  style: { "display": "flex", "justify-content": "space-between", "align-items": "center" }
                                }, [
                                  createVNode(_component_el_link, {
                                    underline: "never",
                                    style: { "font-size": "12px" },
                                    onClick: ($event) => handleInsertVar(item)
                                  }, {
                                    default: withCtx(() => [
                                      createTextVNode(toDisplayString(item.label), 1)
                                    ]),
                                    _: 2
                                  }, 1032, ["onClick"]),
                                  item.label.includes("DATA.") ? (openBlock(), createBlock(_component_el_tag, {
                                    key: 0,
                                    type: "primary",
                                    size: "small"
                                  }, {
                                    default: withCtx(() => [
                                      createTextVNode(toDisplayString(item.type), 1)
                                    ]),
                                    _: 2
                                  }, 1024)) : (openBlock(), createBlock(_component_el_tag, {
                                    key: 1,
                                    type: "warning",
                                    size: "small"
                                  }, {
                                    default: withCtx(() => [
                                      createTextVNode(toDisplayString(item.type), 1)
                                    ]),
                                    _: 2
                                  }, 1024))
                                ]);
                              }), 128))
                            ])
                          ]),
                          _: 1
                        })
                      ]),
                      _: 1
                    })
                  ]),
                  _: 1
                }),
                createVNode(_component_el_col, { span: 6 }, {
                  default: withCtx(() => [
                    createVNode(_component_el_card, {
                      shadow: "never",
                      "body-style": { padding: "0px" }
                    }, {
                      header: withCtx(() => _cache[12] || (_cache[12] = [
                        createElementVNode("div", { class: "card-header" }, [
                          createElementVNode("span", { style: { "font-size": "12px" } }, "函数列表")
                        ], -1)
                      ])),
                      default: withCtx(() => [
                        createVNode(_component_el_scrollbar, { height: "170px" }, {
                          default: withCtx(() => [
                            createVNode(_component_el_tree, {
                              data: functionsList.value,
                              accordion: "",
                              onNodeClick: handleNodeClick,
                              onNodeCollapse: handleNodeCollapse
                            }, {
                              default: withCtx(({ node, data }) => [
                                createElementVNode("div", {
                                  style: normalizeStyle([{ "font-size": "12px", "flex": "1", "display": "flex", "justify-content": "space-between", "align-items": "center" }, { margin: data.value ? "0 12px 0 -18px" : "" }]),
                                  onMouseover: ($event) => handleNodeMouseover(data)
                                }, [
                                  createElementVNode("span", null, toDisplayString(data.value || node.label), 1),
                                  data.type ? (openBlock(), createBlock(_component_el_tag, {
                                    key: 0,
                                    type: data.type
                                  }, {
                                    default: withCtx(() => [
                                      createTextVNode(toDisplayString(node.label), 1)
                                    ]),
                                    _: 2
                                  }, 1032, ["type"])) : createCommentVNode("", true)
                                ], 44, _hoisted_2$o)
                              ]),
                              _: 1
                            }, 8, ["data"])
                          ]),
                          _: 1
                        })
                      ]),
                      _: 1
                    })
                  ]),
                  _: 1
                }),
                createVNode(_component_el_col, { span: 11 }, {
                  default: withCtx(() => [
                    createVNode(_component_el_card, {
                      shadow: "never",
                      style: { "color": "#606266", "line-height": "2", "font-size": "12px" }
                    }, {
                      default: withCtx(() => [
                        createVNode(_component_el_scrollbar, { height: "210px" }, {
                          default: withCtx(() => [
                            tipRedmer.value ? (openBlock(), createElementBlock("div", {
                              key: 0,
                              innerHTML: tipRedmer.value
                            }, null, 8, _hoisted_3$g)) : (openBlock(), createElementBlock("div", _hoisted_4$c, [
                              _cache[14] || (_cache[14] = createElementVNode("ul", { style: { "list-style": "disc", "padding-left": "20px" } }, [
                                createElementVNode("li", null, "请从左侧面板选择字段名和函数，或输入函数"),
                                createElementVNode("li", null, "支持50+常用Excel函数，支持多层嵌套函数调用"),
                                createElementVNode("li", null, "配合自定义组件使用，支持公共变量"),
                                createElementVNode("li", null, "简单公式计算：SUM({基本工资}, {加班工资})")
                              ], -1)),
                              showFastCodeLinks.value.includes(0) ? (openBlock(), createBlock(_component_el_link, {
                                key: 0,
                                type: "primary",
                                underline: "never",
                                style: { "padding-left": "20px", "font-size": "12px" },
                                onClick: _cache[7] || (_cache[7] = ($event) => onFastCode(0))
                              }, {
                                default: withCtx(() => _cache[13] || (_cache[13] = [
                                  createTextVNode(" [请假组件-退餐统计] ")
                                ])),
                                _: 1
                              })) : createCommentVNode("", true)
                            ]))
                          ]),
                          _: 1
                        })
                      ]),
                      _: 1
                    })
                  ]),
                  _: 1
                })
              ]),
              _: 1
            })
          ]),
          _: 1
        }, 8, ["modelValue"])
      ], 64);
    };
  }
};
const _sfc_main$O = {
  __name: "textarea-option",
  props: propsDefinition,
  setup(__props) {
    const props2 = __props;
    const { selected, fieldConfig, formConfig } = toRefs(props2);
    const limitInput = () => {
      if (fieldConfig.value.maxlength > 3e3) {
        fieldConfig.value.maxlength = "3000";
      }
      if (fieldConfig.value.maxlength < 10) {
        fieldConfig.value.maxlength = "10";
      }
    };
    return (_ctx, _cache) => {
      const _component_el_option = resolveComponent("el-option");
      const _component_el_select = resolveComponent("el-select");
      const _component_el_form_item = resolveComponent("el-form-item");
      const _component_el_input = resolveComponent("el-input");
      const _component_el_input_number = resolveComponent("el-input-number");
      const _component_el_switch = resolveComponent("el-switch");
      return openBlock(), createBlock(_sfc_main$R, {
        selected: unref(selected),
        "field-config": unref(fieldConfig),
        "form-config": unref(formConfig)
      }, {
        default: withCtx(({ hideOptions }) => [
          unref(fieldConfig).defaultValue !== void 0 && hideOptions("defaultValue") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 0,
            label: "默认值"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_select, {
                modelValue: unref(fieldConfig).defaultValueType,
                "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(fieldConfig).defaultValueType = $event),
                placeholder: ""
              }, {
                default: withCtx(() => [
                  createVNode(_component_el_option, {
                    label: "自定义",
                    value: 0
                  }),
                  createVNode(_component_el_option, {
                    label: "公式编辑",
                    value: 1
                  })
                ]),
                _: 1
              }, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          unref(fieldConfig).defaultValueType === 0 ? (openBlock(), createBlock(_component_el_form_item, { key: 1 }, {
            default: withCtx(() => [
              createVNode(_component_el_input, {
                modelValue: unref(fieldConfig).defaultValue,
                "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(fieldConfig).defaultValue = $event),
                type: "textarea",
                rows: 4,
                maxlength: unref(fieldConfig).maxlength,
                placeholder: "请输入默认值",
                "show-word-limit": ""
              }, null, 8, ["modelValue", "maxlength"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          unref(fieldConfig).maxlength !== void 0 && hideOptions("maxlength") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 2,
            label: "长度限制"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input, {
                modelValue: unref(fieldConfig).maxlength,
                "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(fieldConfig).maxlength = $event),
                type: "number",
                min: "10",
                max: "3000",
                placeholder: "最大字符长度",
                onBlur: limitInput
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          unref(fieldConfig).rows !== void 0 && hideOptions("rows") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 3,
            label: "行数高度"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input_number, {
                modelValue: unref(fieldConfig).rows,
                "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => unref(fieldConfig).rows = $event),
                min: 1,
                max: 9,
                "controls-position": "right"
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          unref(fieldConfig).ellipsis !== void 0 && hideOptions("ellipsis") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 4,
            label: "展示的行数"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input_number, {
                modelValue: unref(fieldConfig).ellipsis,
                "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => unref(fieldConfig).ellipsis = $event),
                min: 1,
                "controls-position": "right"
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          unref(fieldConfig).expandTips !== void 0 && hideOptions("expandTips") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 5,
            label: "展开操作"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input, {
                modelValue: unref(fieldConfig).expandTips,
                "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => unref(fieldConfig).expandTips = $event),
                placeholder: "展开"
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          unref(fieldConfig).retractTips !== void 0 && hideOptions("retractTips") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 6,
            label: "收起操作"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input, {
                modelValue: unref(fieldConfig).retractTips,
                "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => unref(fieldConfig).retractTips = $event),
                placeholder: "收起"
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          unref(fieldConfig).showWordLimit !== void 0 && hideOptions("showWordLimit") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 7,
            label: "显示计数器"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_switch, {
                modelValue: unref(fieldConfig).showWordLimit,
                "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => unref(fieldConfig).showWordLimit = $event),
                size: "default"
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          unref(fieldConfig).hideTips !== void 0 && hideOptions("hideTips") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 8,
            label: "隐藏展开提示"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_switch, {
                modelValue: unref(fieldConfig).hideTips,
                "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => unref(fieldConfig).hideTips = $event)
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true)
        ]),
        _: 1
      }, 8, ["selected", "field-config", "form-config"]);
    };
  }
};
const _sfc_main$N = {
  __name: "number-option",
  props: propsDefinition,
  setup(__props) {
    const props2 = __props;
    const { selected, widgetList, fieldConfig, formConfig } = toRefs(props2);
    return (_ctx, _cache) => {
      const _component_el_input_number = resolveComponent("el-input-number");
      const _component_el_form_item = resolveComponent("el-form-item");
      const _component_el_input = resolveComponent("el-input");
      return openBlock(), createBlock(_sfc_main$R, {
        selected: unref(selected),
        "field-config": unref(fieldConfig),
        "form-config": unref(formConfig)
      }, {
        default: withCtx(({ hideOptions }) => [
          unref(fieldConfig).defaultValue !== void 0 && hideOptions("defaultValue") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 0,
            label: "默认值"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input_number, {
                modelValue: unref(fieldConfig).defaultValue,
                "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(fieldConfig).defaultValue = $event),
                min: unref(fieldConfig).min,
                max: unref(fieldConfig).max
              }, null, 8, ["modelValue", "min", "max"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          unref(fieldConfig).append !== void 0 && hideOptions("append") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 1,
            label: "后置内容"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input, {
                modelValue: unref(fieldConfig).append,
                "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(fieldConfig).append = $event),
                maxlength: "3",
                placeholder: "请输入后置显示文字"
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          unref(fieldConfig).min !== void 0 && hideOptions("min") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 2,
            label: "最小值"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input_number, {
                modelValue: unref(fieldConfig).min,
                "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(fieldConfig).min = $event),
                min: 0,
                max: unref(fieldConfig).max,
                "controls-position": "right"
              }, null, 8, ["modelValue", "max"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          unref(fieldConfig).max !== void 0 && hideOptions("max") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 3,
            label: "最大值"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input_number, {
                modelValue: unref(fieldConfig).max,
                "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => unref(fieldConfig).max = $event),
                min: unref(fieldConfig).min,
                "controls-position": "right"
              }, null, 8, ["modelValue", "min"])
            ]),
            _: 1
          })) : createCommentVNode("", true)
        ]),
        _: 1
      }, 8, ["selected", "field-config", "form-config"]);
    };
  }
};
const optionItems_vue_vue_type_style_index_0_scoped_ce033424_lang = "";
const _hoisted_1$z = { class: "ep-options__item-label" };
const _hoisted_2$n = { class: "ep-options__item-actions" };
const _hoisted_3$f = { class: "ep-options__item-label" };
const _hoisted_4$b = { class: "ep-options__item-actions" };
const _hoisted_5$9 = { style: { "padding": "16px 10px 10px 10px" } };
const _sfc_main$M = {
  __name: "option-items",
  props: {
    ...propsDefinition,
    multiple: { type: Boolean, default: false }
  },
  setup(__props) {
    const props2 = __props;
    const { selected, fieldConfig, formConfig } = toRefs(props2);
    const { proxy } = getCurrentInstance();
    const selectedItem = ref$1({ label: "", value: "" });
    const optionItemsRef = ref$1();
    const buttonRef = ref$1();
    const popoverRef = ref$1();
    const clickOption = (option) => {
      if (fieldConfig.value.defaultValue === option.value) {
        setTimeout(() => {
          fieldConfig.value.defaultValue = "";
        }, 100);
      }
    };
    const deleteOption = (index) => {
      if (fieldConfig.value.optionItems && fieldConfig.value.optionItems.length <= 2) {
        return proxy.$message.error("至少要保留两个选项.");
      }
      fieldConfig.value.optionItems.splice(index, 1);
    };
    const addOption = () => {
      if (fieldConfig.value.optionItems && fieldConfig.value.optionItems.length < 30) {
        fieldConfig.value.optionItems.push({ label: "新选项", value: "新选项" });
      }
    };
    const editOption = (option, i) => {
      popoverRef.value.hide();
      selectedItem.value = option;
      buttonRef.value = optionItemsRef.value[i];
    };
    const popoverClose = () => {
      popoverRef.value.hide();
    };
    return (_ctx, _cache) => {
      const _component_CaretBottom = resolveComponent("CaretBottom");
      const _component_el_icon = resolveComponent("el-icon");
      const _component_el_checkbox = resolveComponent("el-checkbox");
      const _component_Edit = resolveComponent("Edit");
      const _component_Delete = resolveComponent("Delete");
      const _component_el_button = resolveComponent("el-button");
      const _component_el_checkbox_group = resolveComponent("el-checkbox-group");
      const _component_el_radio = resolveComponent("el-radio");
      const _component_el_radio_group = resolveComponent("el-radio-group");
      const _component_el_input = resolveComponent("el-input");
      const _component_el_form_item = resolveComponent("el-form-item");
      const _component_Close = resolveComponent("Close");
      const _component_el_popover = resolveComponent("el-popover");
      return openBlock(), createElementBlock(Fragment, null, [
        __props.multiple ? (openBlock(), createBlock(_component_el_checkbox_group, {
          key: 0,
          modelValue: unref(fieldConfig).defaultValue,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(fieldConfig).defaultValue = $event),
          class: "ep-options",
          size: "default"
        }, {
          default: withCtx(() => [
            (openBlock(true), createElementBlock(Fragment, null, renderList(unref(fieldConfig).optionItems, (r, i) => {
              return openBlock(), createElementBlock("div", {
                key: i,
                ref_for: true,
                ref_key: "optionItemsRef",
                ref: optionItemsRef,
                class: "ep-options__item"
              }, [
                createVNode(_component_el_checkbox, {
                  label: r.value,
                  value: r.value,
                  disabled: r.disabled
                }, {
                  default: withCtx(() => [
                    createElementVNode("div", _hoisted_1$z, [
                      createVNode(_component_el_icon, null, {
                        default: withCtx(() => [
                          createVNode(_component_CaretBottom)
                        ]),
                        _: 1
                      }),
                      createElementVNode("span", null, toDisplayString(r.label), 1)
                    ])
                  ]),
                  _: 2
                }, 1032, ["label", "value", "disabled"]),
                createElementVNode("div", _hoisted_2$n, [
                  createVNode(_component_el_icon, {
                    class: "btn",
                    size: 16,
                    onClick: ($event) => editOption(r, i)
                  }, {
                    default: withCtx(() => [
                      createVNode(_component_Edit)
                    ]),
                    _: 2
                  }, 1032, ["onClick"]),
                  createVNode(_component_el_icon, {
                    class: "btn",
                    size: 16,
                    onClick: ($event) => deleteOption(i)
                  }, {
                    default: withCtx(() => [
                      createVNode(_component_Delete)
                    ]),
                    _: 2
                  }, 1032, ["onClick"])
                ])
              ]);
            }), 128)),
            createVNode(_component_el_button, {
              icon: "CirclePlus",
              plain: "",
              onClick: addOption
            }, {
              default: withCtx(() => _cache[4] || (_cache[4] = [
                createTextVNode("添加一项")
              ])),
              _: 1
            })
          ]),
          _: 1
        }, 8, ["modelValue"])) : (openBlock(), createBlock(_component_el_radio_group, {
          key: 1,
          modelValue: unref(fieldConfig).defaultValue,
          "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(fieldConfig).defaultValue = $event),
          class: "ep-options",
          size: "default"
        }, {
          default: withCtx(() => [
            (openBlock(true), createElementBlock(Fragment, null, renderList(unref(fieldConfig).optionItems, (r, i) => {
              return openBlock(), createElementBlock("div", {
                key: i,
                ref_for: true,
                ref_key: "optionItemsRef",
                ref: optionItemsRef,
                class: "ep-options__item"
              }, [
                createVNode(_component_el_radio, {
                  label: r.value,
                  value: r.value,
                  disabled: r.disabled,
                  onClick: ($event) => clickOption(r)
                }, {
                  default: withCtx(() => [
                    createElementVNode("div", _hoisted_3$f, [
                      createVNode(_component_el_icon, null, {
                        default: withCtx(() => [
                          createVNode(_component_CaretBottom)
                        ]),
                        _: 1
                      }),
                      createElementVNode("span", null, toDisplayString(r.label), 1)
                    ])
                  ]),
                  _: 2
                }, 1032, ["label", "value", "disabled", "onClick"]),
                createElementVNode("div", _hoisted_4$b, [
                  createVNode(_component_el_icon, {
                    class: "btn",
                    size: 16,
                    onClick: ($event) => editOption(r, i)
                  }, {
                    default: withCtx(() => [
                      createVNode(_component_Edit)
                    ]),
                    _: 2
                  }, 1032, ["onClick"]),
                  createVNode(_component_el_icon, {
                    class: "btn",
                    size: 16,
                    onClick: ($event) => deleteOption(i)
                  }, {
                    default: withCtx(() => [
                      createVNode(_component_Delete)
                    ]),
                    _: 2
                  }, 1032, ["onClick"])
                ])
              ]);
            }), 128)),
            createVNode(_component_el_button, {
              icon: "CirclePlus",
              plain: "",
              onClick: addOption
            }, {
              default: withCtx(() => _cache[5] || (_cache[5] = [
                createTextVNode("添加一项")
              ])),
              _: 1
            })
          ]),
          _: 1
        }, 8, ["modelValue"])),
        createVNode(_component_el_popover, {
          ref_key: "popoverRef",
          ref: popoverRef,
          "virtual-ref": buttonRef.value,
          trigger: "click",
          placement: "right-start",
          width: "280",
          "virtual-triggering": ""
        }, {
          default: withCtx(() => [
            createElementVNode("div", _hoisted_5$9, [
              createVNode(_component_el_form_item, {
                label: "显示值",
                "label-width": "55px"
              }, {
                default: withCtx(() => [
                  createVNode(_component_el_input, {
                    modelValue: selectedItem.value.label,
                    "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => selectedItem.value.label = $event)
                  }, null, 8, ["modelValue"])
                ]),
                _: 1
              }),
              createVNode(_component_el_form_item, {
                label: "选项值",
                "label-width": "55px"
              }, {
                default: withCtx(() => [
                  createVNode(_component_el_input, {
                    modelValue: selectedItem.value.value,
                    "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => selectedItem.value.value = $event)
                  }, null, 8, ["modelValue"])
                ]),
                _: 1
              })
            ]),
            createVNode(_component_el_icon, {
              class: "ep-popover-close",
              onClick: popoverClose
            }, {
              default: withCtx(() => [
                createVNode(_component_Close)
              ]),
              _: 1
            })
          ]),
          _: 1
        }, 8, ["virtual-ref"])
      ], 64);
    };
  }
};
const optionItems = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["__scopeId", "data-v-ce033424"]]);
const _sfc_main$L = {
  __name: "radio-option",
  props: propsDefinition,
  setup(__props) {
    const props2 = __props;
    const { selected, fieldConfig, formConfig } = toRefs(props2);
    return (_ctx, _cache) => {
      const _component_el_radio_button = resolveComponent("el-radio-button");
      const _component_el_radio_group = resolveComponent("el-radio-group");
      const _component_el_form_item = resolveComponent("el-form-item");
      return openBlock(), createBlock(_sfc_main$R, {
        selected: unref(selected),
        "field-config": unref(fieldConfig),
        "form-config": unref(formConfig)
      }, {
        default: withCtx(({ hideOptions }) => [
          unref(fieldConfig).inline !== void 0 && hideOptions("inline") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 0,
            label: "排列方式"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_radio_group, {
                modelValue: unref(fieldConfig).inline,
                "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(fieldConfig).inline = $event),
                class: "ep-setting-panel-container__radio-group"
              }, {
                default: withCtx(() => [
                  createVNode(_component_el_radio_button, {
                    label: "水平排列",
                    value: true
                  }),
                  createVNode(_component_el_radio_button, {
                    label: "垂直排列",
                    value: false
                  })
                ]),
                _: 1
              }, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          unref(fieldConfig).optionItems !== void 0 ? (openBlock(), createBlock(optionItems, {
            key: 1,
            selected: unref(selected),
            "field-config": unref(fieldConfig),
            "form-config": unref(formConfig)
          }, null, 8, ["selected", "field-config", "form-config"])) : createCommentVNode("", true)
        ]),
        _: 1
      }, 8, ["selected", "field-config", "form-config"]);
    };
  }
};
const _sfc_main$K = {
  __name: "checkbox-option",
  props: propsDefinition,
  setup(__props) {
    const props2 = __props;
    const { selected, fieldConfig, formConfig } = toRefs(props2);
    return (_ctx, _cache) => {
      const _component_el_radio_button = resolveComponent("el-radio-button");
      const _component_el_radio_group = resolveComponent("el-radio-group");
      const _component_el_form_item = resolveComponent("el-form-item");
      return openBlock(), createBlock(_sfc_main$R, {
        selected: unref(selected),
        "field-config": unref(fieldConfig),
        "form-config": unref(formConfig)
      }, {
        default: withCtx(({ hideOptions }) => [
          unref(fieldConfig).inline !== void 0 && hideOptions("inline") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 0,
            label: "排列方式"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_radio_group, {
                modelValue: unref(fieldConfig).inline,
                "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(fieldConfig).inline = $event),
                class: "ep-setting-panel-container__radio-group"
              }, {
                default: withCtx(() => [
                  createVNode(_component_el_radio_button, {
                    label: "水平排列",
                    value: true
                  }),
                  createVNode(_component_el_radio_button, {
                    label: "垂直排列",
                    value: false
                  })
                ]),
                _: 1
              }, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          unref(fieldConfig).optionItems !== void 0 ? (openBlock(), createBlock(optionItems, {
            key: 1,
            selected: unref(selected),
            "field-config": unref(fieldConfig),
            "form-config": unref(formConfig),
            multiple: ""
          }, null, 8, ["selected", "field-config", "form-config"])) : createCommentVNode("", true)
        ]),
        _: 1
      }, 8, ["selected", "field-config", "form-config"]);
    };
  }
};
const _sfc_main$J = {
  __name: "checkboxlist-option",
  props: propsDefinition,
  setup(__props) {
    const props2 = __props;
    const { selected, fieldConfig, formConfig } = toRefs(props2);
    return (_ctx, _cache) => {
      const _component_el_switch = resolveComponent("el-switch");
      const _component_el_form_item = resolveComponent("el-form-item");
      const _component_el_input_number = resolveComponent("el-input-number");
      return openBlock(), createBlock(_sfc_main$R, {
        selected: unref(selected),
        "field-config": unref(fieldConfig),
        "form-config": unref(formConfig)
      }, {
        default: withCtx(({ hideOptions }) => [
          unref(fieldConfig).optionItems !== void 0 ? (openBlock(), createBlock(optionItems, {
            key: 0,
            selected: unref(selected),
            "field-config": unref(fieldConfig),
            "form-config": unref(formConfig),
            multiple: ""
          }, null, 8, ["selected", "field-config", "form-config"])) : createCommentVNode("", true),
          unref(fieldConfig).ellipsis !== void 0 && hideOptions("ellipsis") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 1,
            label: "显示省略号"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_switch, {
                modelValue: unref(fieldConfig).ellipsis,
                "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(fieldConfig).ellipsis = $event),
                size: "default"
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          unref(fieldConfig).collapseTags !== void 0 && hideOptions("collapseTags") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 2,
            label: "折叠标签"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_switch, {
                modelValue: unref(fieldConfig).collapseTags,
                "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(fieldConfig).collapseTags = $event),
                size: "default"
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          hideOptions("maxCollapseTags") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 3,
            label: "显示标签数量"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input_number, {
                modelValue: unref(fieldConfig).maxCollapseTags,
                "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(fieldConfig).maxCollapseTags = $event),
                disabled: !unref(fieldConfig).collapseTags,
                min: 1,
                max: 20,
                "controls-position": "right"
              }, null, 8, ["modelValue", "disabled"])
            ]),
            _: 1
          })) : createCommentVNode("", true)
        ]),
        _: 1
      }, 8, ["selected", "field-config", "form-config"]);
    };
  }
};
const _sfc_main$I = {
  __name: "select-option",
  props: propsDefinition,
  setup(__props) {
    const props2 = __props;
    const { selected, fieldConfig, formConfig } = toRefs(props2);
    return (_ctx, _cache) => {
      return openBlock(), createBlock(_sfc_main$R, {
        selected: unref(selected),
        "field-config": unref(fieldConfig),
        "form-config": unref(formConfig)
      }, {
        default: withCtx(() => [
          unref(fieldConfig).optionItems !== void 0 ? (openBlock(), createBlock(optionItems, {
            key: 0,
            selected: unref(selected),
            "field-config": unref(fieldConfig),
            "form-config": unref(formConfig)
          }, null, 8, ["selected", "field-config", "form-config"])) : createCommentVNode("", true)
        ]),
        _: 1
      }, 8, ["selected", "field-config", "form-config"]);
    };
  }
};
const _sfc_main$H = {
  __name: "time-option",
  props: propsDefinition,
  setup(__props) {
    const props2 = __props;
    const { selected, fieldConfig, formConfig } = toRefs(props2);
    return (_ctx, _cache) => {
      const _component_el_time_picker = resolveComponent("el-time-picker");
      const _component_el_form_item = resolveComponent("el-form-item");
      const _component_el_input = resolveComponent("el-input");
      return openBlock(), createBlock(_sfc_main$R, {
        selected: unref(selected),
        "field-config": unref(fieldConfig),
        "form-config": unref(formConfig)
      }, {
        default: withCtx(({ hideOptions }) => [
          unref(fieldConfig).defaultValue !== void 0 && hideOptions("defaultValue") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 0,
            label: "默认值"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_time_picker, {
                modelValue: unref(fieldConfig).defaultValue,
                "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(fieldConfig).defaultValue = $event),
                format: unref(fieldConfig).format || "HH:mm:ss",
                "value-format": "HH:mm:ss"
              }, null, 8, ["modelValue", "format"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          unref(fieldConfig).format !== void 0 && hideOptions("format") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 1,
            label: "时间格式"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input, {
                modelValue: unref(fieldConfig).format,
                "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(fieldConfig).format = $event),
                placeholder: "如：HH时mm分"
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true)
        ]),
        _: 1
      }, 8, ["selected", "field-config", "form-config"]);
    };
  }
};
const _sfc_main$G = {
  __name: "date-option",
  props: propsDefinition,
  setup(__props) {
    const props2 = __props;
    const { selected, fieldConfig, formConfig } = toRefs(props2);
    const dateType = ref$1("");
    watch(dateType, (val) => {
      const arr = val.split(",");
      fieldConfig.value.type = arr[0];
      fieldConfig.value.format = arr[1];
    });
    watch(
      selected,
      () => {
        const arr = [fieldConfig.value.type || "date", fieldConfig.value.format || "YYYY-MM-DD"];
        dateType.value = arr.join(",");
      },
      { immediate: true }
    );
    const format = computed(() => {
      if (fieldConfig.value.format) {
        return fieldConfig.value.format;
      }
      return "YYYY-MM-DD";
    });
    return (_ctx, _cache) => {
      const _component_el_date_picker = resolveComponent("el-date-picker");
      const _component_el_form_item = resolveComponent("el-form-item");
      const _component_el_option = resolveComponent("el-option");
      const _component_el_select = resolveComponent("el-select");
      return openBlock(), createBlock(_sfc_main$R, {
        selected: unref(selected),
        "field-config": unref(fieldConfig),
        "form-config": unref(formConfig)
      }, {
        default: withCtx(({ hideOptions }) => [
          unref(fieldConfig).defaultValue !== void 0 && hideOptions("defaultValue") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 0,
            label: "默认值"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_date_picker, {
                modelValue: unref(fieldConfig).defaultValue,
                "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(fieldConfig).defaultValue = $event),
                type: unref(fieldConfig).type,
                format: format.value,
                "value-format": format.value
              }, null, 8, ["modelValue", "type", "format", "value-format"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          unref(fieldConfig).type !== void 0 && hideOptions("type") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 1,
            label: "显示类型"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_select, {
                modelValue: dateType.value,
                "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => dateType.value = $event)
              }, {
                default: withCtx(() => [
                  createVNode(_component_el_option, {
                    label: "年",
                    value: "year,YYYY"
                  }),
                  createVNode(_component_el_option, {
                    label: "年-月",
                    value: "month,YYYY-MM"
                  }),
                  createVNode(_component_el_option, {
                    label: "年-月-日",
                    value: "date,YYYY-MM-DD"
                  }),
                  createVNode(_component_el_option, {
                    label: "年-月-日 时:分",
                    value: "datetime,YYYY-MM-DD HH:mm"
                  }),
                  createVNode(_component_el_option, {
                    label: "年-月-日 时:分:秒",
                    value: "datetime,YYYY-MM-DD HH:mm:ss"
                  })
                ]),
                _: 1
              }, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true)
        ]),
        _: 1
      }, 8, ["selected", "field-config", "form-config"]);
    };
  }
};
const _hoisted_1$y = { class: "dialog-footer" };
const _sfc_main$F = {
  __name: "cascader-option",
  props: propsDefinition,
  setup(__props) {
    const props2 = __props;
    const { selected, fieldConfig, formConfig } = toRefs(props2);
    const dialogCode = ref$1(false);
    const optionsJSON = ref$1("");
    const openDialog = () => {
      optionsJSON.value = JSON.stringify(fieldConfig.value.optionItems || [], null, "  ");
      dialogCode.value = true;
    };
    const handleSave = () => {
      dialogCode.value = false;
      fieldConfig.value.optionItems = JSON.parse(optionsJSON.value);
    };
    return (_ctx, _cache) => {
      const _component_el_input = resolveComponent("el-input");
      const _component_el_form_item = resolveComponent("el-form-item");
      const _component_el_button = resolveComponent("el-button");
      const _component_el_radio_button = resolveComponent("el-radio-button");
      const _component_el_radio_group = resolveComponent("el-radio-group");
      const _component_code_editor = resolveComponent("code-editor");
      const _component_el_dialog = resolveComponent("el-dialog");
      return openBlock(), createElementBlock(Fragment, null, [
        createVNode(_sfc_main$R, {
          selected: unref(selected),
          "field-config": unref(fieldConfig),
          "form-config": unref(formConfig)
        }, {
          default: withCtx(({ hideOptions }) => [
            unref(fieldConfig).defaultValue !== void 0 && hideOptions("defaultValue") ? (openBlock(), createBlock(_component_el_form_item, {
              key: 0,
              label: "默认值"
            }, {
              default: withCtx(() => [
                createVNode(_component_el_input, {
                  modelValue: unref(fieldConfig).defaultValue,
                  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(fieldConfig).defaultValue = $event)
                }, null, 8, ["modelValue"])
              ]),
              _: 1
            })) : createCommentVNode("", true),
            createVNode(_component_el_form_item, { label: "数据源" }, {
              default: withCtx(() => [
                createVNode(_component_el_button, {
                  style: { "flex": "1" },
                  plain: "",
                  onClick: openDialog
                }, {
                  default: withCtx(() => _cache[4] || (_cache[4] = [
                    createTextVNode("编辑代码")
                  ])),
                  _: 1
                })
              ]),
              _: 1
            }),
            unref(fieldConfig).expandTrigger !== void 0 && hideOptions("expandTrigger") ? (openBlock(), createBlock(_component_el_form_item, {
              key: 1,
              label: "展开方式"
            }, {
              default: withCtx(() => [
                createVNode(_component_el_radio_group, {
                  modelValue: unref(fieldConfig).expandTrigger,
                  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(fieldConfig).expandTrigger = $event)
                }, {
                  default: withCtx(() => [
                    createVNode(_component_el_radio_button, {
                      label: "click",
                      value: "click"
                    }, {
                      default: withCtx(() => _cache[5] || (_cache[5] = [
                        createTextVNode("click")
                      ])),
                      _: 1
                    }),
                    createVNode(_component_el_radio_button, {
                      label: "hover",
                      value: "hover"
                    }, {
                      default: withCtx(() => _cache[6] || (_cache[6] = [
                        createTextVNode("hover")
                      ])),
                      _: 1
                    })
                  ]),
                  _: 1
                }, 8, ["modelValue"])
              ]),
              _: 1
            })) : createCommentVNode("", true)
          ]),
          _: 1
        }, 8, ["selected", "field-config", "form-config"]),
        createVNode(_component_el_dialog, {
          modelValue: dialogCode.value,
          "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => dialogCode.value = $event),
          title: "数据源",
          "close-on-click-modal": false,
          "close-on-press-escape": false,
          "destroy-on-close": ""
        }, {
          footer: withCtx(() => [
            createElementVNode("span", _hoisted_1$y, [
              createVNode(_component_el_button, {
                type: "primary",
                onClick: handleSave
              }, {
                default: withCtx(() => _cache[7] || (_cache[7] = [
                  createTextVNode("保存")
                ])),
                _: 1
              })
            ])
          ]),
          default: withCtx(() => [
            createVNode(_component_code_editor, {
              modelValue: optionsJSON.value,
              "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => optionsJSON.value = $event),
              mode: "json"
            }, null, 8, ["modelValue"])
          ]),
          _: 1
        }, 8, ["modelValue"])
      ], 64);
    };
  }
};
const _sfc_main$E = {
  __name: "divider-option",
  props: propsDefinition,
  setup(__props) {
    const props2 = __props;
    const { selected, fieldConfig, formConfig } = toRefs(props2);
    return (_ctx, _cache) => {
      const _component_el_option = resolveComponent("el-option");
      const _component_el_select = resolveComponent("el-select");
      const _component_el_form_item = resolveComponent("el-form-item");
      const _component_el_input = resolveComponent("el-input");
      return openBlock(), createBlock(_sfc_main$R, {
        selected: unref(selected),
        "field-config": unref(fieldConfig),
        "form-config": unref(formConfig)
      }, {
        default: withCtx(({ hideOptions }) => [
          unref(fieldConfig).direction !== void 0 && hideOptions("direction") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 0,
            label: "分割线的方向"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_select, {
                modelValue: unref(fieldConfig).direction,
                "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(fieldConfig).direction = $event),
                placeholder: ""
              }, {
                default: withCtx(() => [
                  createVNode(_component_el_option, {
                    label: "横向",
                    value: "horizontal"
                  }),
                  createVNode(_component_el_option, {
                    label: "垂直",
                    value: "vertical"
                  })
                ]),
                _: 1
              }, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          unref(fieldConfig).title !== void 0 && hideOptions("title") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 1,
            label: "分割线的标题"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input, {
                modelValue: unref(fieldConfig).title,
                "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(fieldConfig).title = $event),
                maxlength: "20"
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          unref(fieldConfig).titlePosition !== void 0 && hideOptions("titlePosition") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 2,
            label: "标题位置"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_select, {
                modelValue: unref(fieldConfig).titlePosition,
                "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(fieldConfig).titlePosition = $event),
                placeholder: ""
              }, {
                default: withCtx(() => [
                  createVNode(_component_el_option, {
                    label: "左侧显示",
                    value: "left"
                  }),
                  createVNode(_component_el_option, {
                    label: "居中显示",
                    value: "center"
                  }),
                  createVNode(_component_el_option, {
                    label: "右侧显示",
                    value: "right"
                  })
                ]),
                _: 1
              }, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          unref(fieldConfig).lineStyle !== void 0 && hideOptions("lineStyle") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 3,
            label: "分割线的样式"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_select, {
                modelValue: unref(fieldConfig).lineStyle,
                "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => unref(fieldConfig).lineStyle = $event),
                placeholder: ""
              }, {
                default: withCtx(() => [
                  createVNode(_component_el_option, {
                    label: "虚线",
                    value: "dashed"
                  }),
                  createVNode(_component_el_option, {
                    label: "实线",
                    value: "solid"
                  })
                ]),
                _: 1
              }, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true)
        ]),
        "base-advanced": withCtx(() => _cache[4] || (_cache[4] = [
          createElementVNode("div", null, null, -1)
        ])),
        _: 1
      }, 8, ["selected", "field-config", "form-config"]);
    };
  }
};
const _sfc_main$D = {
  __name: "fileupload-option",
  props: propsDefinition,
  setup(__props) {
    const props2 = __props;
    const { selected, fieldConfig, formConfig } = toRefs(props2);
    return (_ctx, _cache) => {
      const _component_el_input_number = resolveComponent("el-input-number");
      const _component_el_form_item = resolveComponent("el-form-item");
      const _component_el_input = resolveComponent("el-input");
      const _component_el_option = resolveComponent("el-option");
      const _component_el_select = resolveComponent("el-select");
      return openBlock(), createBlock(_sfc_main$R, {
        selected: unref(selected),
        "field-config": unref(fieldConfig),
        "form-config": unref(formConfig)
      }, {
        default: withCtx(({ hideOptions }) => [
          hideOptions("limit") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 0,
            label: "附件数量"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input_number, {
                modelValue: unref(fieldConfig).limit,
                "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(fieldConfig).limit = $event),
                min: 1,
                max: 10,
                "controls-position": "right"
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          hideOptions("fileMaxSize") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 1,
            label: "附件大小"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input_number, {
                modelValue: unref(fieldConfig).fileMaxSize,
                "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(fieldConfig).fileMaxSize = $event),
                min: 1,
                max: 50,
                "controls-position": "right"
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          hideOptions("tip") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 2,
            label: "上传提示"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input, {
                modelValue: unref(fieldConfig).tip,
                "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(fieldConfig).tip = $event),
                placeholder: "",
                style: { "font-size": "13px" }
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          hideOptions("listType") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 3,
            label: "展示风格"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_select, {
                modelValue: unref(fieldConfig).listType,
                "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => unref(fieldConfig).listType = $event),
                placeholder: ""
              }, {
                default: withCtx(() => [
                  createVNode(_component_el_option, {
                    label: "文件",
                    value: "text"
                  }),
                  createVNode(_component_el_option, {
                    label: "小图标",
                    value: "picture"
                  }),
                  createVNode(_component_el_option, {
                    label: "大图标",
                    value: "picture-card"
                  })
                ]),
                _: 1
              }, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          hideOptions("accept") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 4,
            label: "限制文件类型(多个类型，逗号分隔)"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input, {
                modelValue: unref(fieldConfig).accept,
                "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => unref(fieldConfig).accept = $event),
                type: "textarea",
                maxlength: "100",
                placeholder: "如：.doc,.docx,.pdf",
                autosize: ""
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true)
        ]),
        _: 1
      }, 8, ["selected", "field-config", "form-config"]);
    };
  }
};
const _sfc_main$C = {
  __name: "picture-option",
  props: propsDefinition,
  setup(__props) {
    const props2 = __props;
    const { selected, fieldConfig, formConfig } = toRefs(props2);
    return (_ctx, _cache) => {
      const _component_el_input_number = resolveComponent("el-input-number");
      const _component_el_form_item = resolveComponent("el-form-item");
      const _component_el_input = resolveComponent("el-input");
      const _component_el_option = resolveComponent("el-option");
      const _component_el_select = resolveComponent("el-select");
      const _component_el_switch = resolveComponent("el-switch");
      return openBlock(), createBlock(_sfc_main$R, {
        selected: unref(selected),
        "field-config": unref(fieldConfig),
        "form-config": unref(formConfig)
      }, {
        default: withCtx(({ hideOptions }) => [
          unref(fieldConfig).limit !== void 0 && hideOptions("limit") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 0,
            label: "附件数量"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input_number, {
                modelValue: unref(fieldConfig).limit,
                "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(fieldConfig).limit = $event),
                min: 1,
                max: 20,
                "controls-position": "right"
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          unref(fieldConfig).fileMaxSize !== void 0 && hideOptions("fileMaxSize") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 1,
            label: "附件大小"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input_number, {
                modelValue: unref(fieldConfig).fileMaxSize,
                "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(fieldConfig).fileMaxSize = $event),
                min: 1,
                max: 20,
                "controls-position": "right"
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          unref(fieldConfig).tip !== void 0 && hideOptions("tip") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 2,
            label: "上传提示"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input, {
                modelValue: unref(fieldConfig).tip,
                "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(fieldConfig).tip = $event),
                placeholder: "",
                style: { "font-size": "13px" }
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          hideOptions("accept") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 3,
            label: "限制图片类型(多个类型，逗号分隔)"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input, {
                modelValue: unref(fieldConfig).accept,
                "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => unref(fieldConfig).accept = $event),
                type: "textarea",
                maxlength: "100",
                placeholder: "如：.jpg,.jpeg,.png",
                autosize: ""
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          unref(fieldConfig).reduce !== void 0 && hideOptions("reduce") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 4,
            label: "照片压缩"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_select, {
                modelValue: unref(fieldConfig).reduce,
                "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => unref(fieldConfig).reduce = $event),
                placeholder: ""
              }, {
                default: withCtx(() => [
                  createVNode(_component_el_option, {
                    label: "原图",
                    value: 0
                  }),
                  createVNode(_component_el_option, {
                    label: "高清无损",
                    value: 1
                  }),
                  createVNode(_component_el_option, {
                    label: "高质量",
                    value: 2
                  })
                ]),
                _: 1
              }, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          unref(fieldConfig).camera !== void 0 && hideOptions("camera") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 5,
            label: "控制限制"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_switch, {
                modelValue: unref(fieldConfig).camera,
                "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => unref(fieldConfig).camera = $event),
                size: "default"
              }, null, 8, ["modelValue"]),
              createElementVNode("span", {
                class: normalizeClass(["label-switch", { "color-g9": !unref(fieldConfig).camera }])
              }, "(成员仅可在手机端拍照上传)", 2)
            ]),
            _: 1
          })) : createCommentVNode("", true)
        ]),
        _: 1
      }, 8, ["selected", "field-config", "form-config"]);
    };
  }
};
const _hoisted_1$x = { style: { "display": "block" } };
const _hoisted_2$m = { class: "label-switch color-g9" };
const _sfc_main$B = {
  __name: "correlation-option",
  props: propsDefinition,
  setup(__props) {
    const correlationOptions = inject("correlationOptions");
    const props2 = __props;
    const { selected, fieldConfig, formConfig } = toRefs(props2);
    const correlationOptionsList = computed(() => {
      return correlationOptions.value || [];
    });
    return (_ctx, _cache) => {
      const _component_el_switch = resolveComponent("el-switch");
      const _component_el_form_item = resolveComponent("el-form-item");
      const _component_el_option = resolveComponent("el-option");
      const _component_el_option_group = resolveComponent("el-option-group");
      const _component_el_select = resolveComponent("el-select");
      const _component_el_input_number = resolveComponent("el-input-number");
      const _component_el_input = resolveComponent("el-input");
      return openBlock(), createBlock(_sfc_main$R, {
        selected: unref(selected),
        "field-config": unref(fieldConfig),
        "form-config": unref(formConfig)
      }, {
        default: withCtx(({ hideOptions }) => [
          createVNode(_component_el_form_item, { label: "可选范围" }, {
            default: withCtx(() => [
              createElementVNode("div", _hoisted_1$x, [
                createVNode(_component_el_switch, {
                  modelValue: unref(fieldConfig).selectType,
                  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(fieldConfig).selectType = $event),
                  size: "default",
                  onChange: _cache[1] || (_cache[1] = ($event) => unref(fieldConfig).selectRange = [])
                }, null, 8, ["modelValue"]),
                withDirectives(createElementVNode("span", _hoisted_2$m, " (可关联全部审批单，并随着应用的新增/停用变化) ", 512), [
                  [vShow, !unref(fieldConfig).selectType]
                ])
              ])
            ]),
            _: 1
          }),
          withDirectives(createVNode(_component_el_form_item, {
            label: "选择审批",
            required: ""
          }, {
            default: withCtx(() => [
              createVNode(_component_el_select, {
                modelValue: unref(fieldConfig).selectRange,
                "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(fieldConfig).selectRange = $event),
                multiple: "",
                "collapse-tags-tooltip": "",
                "max-collapse-tags": 1
              }, {
                default: withCtx(() => [
                  (openBlock(true), createElementBlock(Fragment, null, renderList(correlationOptionsList.value, (group) => {
                    return openBlock(), createBlock(_component_el_option_group, {
                      key: group.label,
                      label: group.label
                    }, {
                      default: withCtx(() => [
                        (openBlock(true), createElementBlock(Fragment, null, renderList(group.options, (item) => {
                          return openBlock(), createBlock(_component_el_option, {
                            key: item.value,
                            label: item.label,
                            value: item.value
                          }, null, 8, ["label", "value"]);
                        }), 128))
                      ]),
                      _: 2
                    }, 1032, ["label"]);
                  }), 128))
                ]),
                _: 1
              }, 8, ["modelValue"])
            ]),
            _: 1
          }, 512), [
            [vShow, unref(fieldConfig).selectType]
          ]),
          unref(fieldConfig).limit !== void 0 && hideOptions("limit") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 0,
            label: "最大关联数"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input_number, {
                modelValue: unref(fieldConfig).limit,
                "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => unref(fieldConfig).limit = $event),
                min: 1,
                max: 20,
                "controls-position": "right"
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          unref(fieldConfig).tip !== void 0 && hideOptions("tip") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 1,
            label: "提示内容"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input, {
                modelValue: unref(fieldConfig).tip,
                "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => unref(fieldConfig).tip = $event),
                placeholder: "",
                style: { "font-size": "13px" }
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true)
        ]),
        _: 1
      }, 8, ["selected", "field-config", "form-config"]);
    };
  }
};
const _hoisted_1$w = { style: { "display": "flex", "justify-content": "space-between" } };
const _hoisted_2$l = { style: { "flex": "1", "display": "flex", "justify-content": "space-between", "font-size": "12px" } };
const _hoisted_3$e = { style: { "color": "#a8abb2" } };
const _hoisted_4$a = { style: { "color": "#909090" } };
const _hoisted_5$8 = { style: { "display": "flex", "align-items": "center", "margin-bottom": "10px" } };
const _hoisted_6$6 = { class: "dialog-footer" };
const _sfc_main$A = {
  __name: "card-option",
  props: propsDefinition,
  setup(__props) {
    const props2 = __props;
    const { selected, fieldConfig, formConfig, widgetList } = toRefs(props2);
    const { proxy } = getCurrentInstance();
    const dialogCode = ref$1(false);
    const variableCode = ref$1("");
    const variableName = ref$1("");
    const isEdit = ref$1(false);
    const initVars = computed(() => {
      if (widgetList.value.find((x) => x.type === "card" && x.options.name === "leave")) {
        return [
          "早餐时段",
          "午餐时段",
          "晚餐时段",
          "早餐价格",
          "午餐价格",
          "晚餐价格",
          "是否为工作日",
          "应退早餐",
          "应退午餐",
          "应退晚餐"
        ];
      }
      return [];
    });
    function objToTree(obj) {
      return Object.entries(obj).map(([key, value]) => {
        let type2 = "Object";
        if (Array.isArray(value)) {
          type2 = "Array";
        } else if (typeof value === "number") {
          type2 = "Number";
        } else if (typeof value === "function") {
          type2 = "Function";
        } else if (isFunctionString(value)) {
          type2 = "Function";
        } else {
          type2 = "String";
        }
        return {
          label: key,
          value,
          type: type2,
          deleted: initVars.value.includes(key)
          // 是否为内置变量，内置变量不允许删除
        };
      });
    }
    function isFunctionString(str) {
      try {
        new Function(str);
        return true;
      } catch (e) {
        return false;
      }
    }
    const treeData = computed(() => {
      if (!selected.value.options.publicVars)
        return [];
      return objToTree(selected.value.options.publicVars);
    });
    const selectedValue = ref$1("");
    const handleNodeClick = (data) => {
      selectedValue.value = selected.value.options.publicVars[data.label];
    };
    const remove = (node, data) => {
      if (selected.value && selected.value.options.publicVars && data && data.label) {
        delete selected.value.options.publicVars[data.label];
      }
    };
    const edit = (node, data) => {
      if (typeof data.value === "string" && isFunctionString(data.value)) {
        variableCode.value = data.value;
      } else {
        variableCode.value = JSON.stringify(data.value);
      }
      variableName.value = data.label;
      isEdit.value = true;
      dialogCode.value = true;
    };
    const addVars = () => {
      variableName.value = "新建变量";
      variableCode.value = "这里输入变量的值，可以是字符串、数字、数组、对象，甚至是函数";
      isEdit.value = false;
      dialogCode.value = true;
    };
    const handleSave = () => {
      if (!variableName.value || variableName.value.trim() === "") {
        proxy.$message.error("变量名称不能为空.");
        return;
      }
      if (!isEdit.value && selected.value.options.publicVars && selected.value.options.publicVars[variableName.value.trim()]) {
        proxy.$message.error("变量名称已存在，请更换一个.");
        return;
      }
      try {
        selected.value.options.publicVars[variableName.value.trim()] = JSON.parse(variableCode.value);
      } catch (e) {
        selected.value.options.publicVars[variableName.value.trim()] = variableCode.value;
      }
      dialogCode.value = false;
    };
    return (_ctx, _cache) => {
      const _component_el_button = resolveComponent("el-button");
      const _component_el_tree = resolveComponent("el-tree");
      const _component_el_scrollbar = resolveComponent("el-scrollbar");
      const _component_el_card = resolveComponent("el-card");
      const _component_el_input = resolveComponent("el-input");
      const _component_code_editor = resolveComponent("code-editor");
      const _component_el_dialog = resolveComponent("el-dialog");
      return openBlock(), createElementBlock(Fragment, null, [
        createVNode(_sfc_main$R, {
          selected: unref(selected),
          "field-config": unref(fieldConfig),
          "form-config": unref(formConfig)
        }, {
          advanced: withCtx(() => [
            createVNode(_component_el_card, {
              style: { "font-size": "12px" },
              shadow: "never"
            }, {
              header: withCtx(() => [
                createElementVNode("div", _hoisted_1$w, [
                  _cache[5] || (_cache[5] = createElementVNode("span", null, "公共变量", -1)),
                  createVNode(_component_el_button, {
                    style: { "margin-left": "24px" },
                    type: "primary",
                    link: "",
                    onClick: addVars
                  }, {
                    default: withCtx(() => _cache[4] || (_cache[4] = [
                      createTextVNode(" 添加 ")
                    ])),
                    _: 1
                  })
                ])
              ]),
              footer: withCtx(() => [
                createVNode(_component_el_scrollbar, { "max-height": "350px" }, {
                  default: withCtx(() => [
                    createElementVNode("div", _hoisted_4$a, toDisplayString(selectedValue.value), 1)
                  ]),
                  _: 1
                })
              ]),
              default: withCtx(() => [
                createVNode(_component_el_scrollbar, { height: "260px" }, {
                  default: withCtx(() => [
                    createVNode(_component_el_tree, {
                      style: { "max-width": "300px" },
                      data: treeData.value,
                      "empty-text": "无数据",
                      onNodeClick: handleNodeClick
                    }, {
                      default: withCtx(({ node, data }) => [
                        createElementVNode("div", _hoisted_2$l, [
                          createElementVNode("span", null, toDisplayString(node.label), 1),
                          createElementVNode("div", null, [
                            createElementVNode("span", _hoisted_3$e, toDisplayString(data.type), 1),
                            createVNode(_component_el_button, {
                              style: { "margin-left": "20px" },
                              type: "primary",
                              link: "",
                              onClick: ($event) => edit(node, data)
                            }, {
                              default: withCtx(() => _cache[6] || (_cache[6] = [
                                createTextVNode(" 编辑 ")
                              ])),
                              _: 2
                            }, 1032, ["onClick"]),
                            createVNode(_component_el_button, {
                              style: { "margin-left": "10px" },
                              type: "danger",
                              link: "",
                              disabled: data.deleted,
                              onClick: ($event) => remove(node, data)
                            }, {
                              default: withCtx(() => _cache[7] || (_cache[7] = [
                                createTextVNode(" 移除 ")
                              ])),
                              _: 2
                            }, 1032, ["disabled", "onClick"])
                          ])
                        ])
                      ]),
                      _: 1
                    }, 8, ["data"])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            })
          ]),
          _: 1
        }, 8, ["selected", "field-config", "form-config"]),
        createVNode(_component_el_dialog, {
          modelValue: dialogCode.value,
          "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => dialogCode.value = $event),
          title: "公共变量设置",
          "close-on-click-modal": false,
          "close-on-press-escape": false,
          "destroy-on-close": ""
        }, {
          footer: withCtx(() => [
            createElementVNode("span", _hoisted_6$6, [
              createVNode(_component_el_button, {
                type: "primary",
                onClick: handleSave
              }, {
                default: withCtx(() => _cache[9] || (_cache[9] = [
                  createTextVNode("确定")
                ])),
                _: 1
              }),
              createVNode(_component_el_button, {
                onClick: _cache[2] || (_cache[2] = ($event) => dialogCode.value = false)
              }, {
                default: withCtx(() => _cache[10] || (_cache[10] = [
                  createTextVNode("关闭")
                ])),
                _: 1
              })
            ])
          ]),
          default: withCtx(() => [
            createElementVNode("div", _hoisted_5$8, [
              _cache[8] || (_cache[8] = createElementVNode("span", null, "变量名称", -1)),
              createVNode(_component_el_input, {
                modelValue: variableName.value,
                "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => variableName.value = $event),
                disabled: isEdit.value,
                size: "default",
                style: { "width": "240px", "margin-left": "10px" }
              }, null, 8, ["modelValue", "disabled"])
            ]),
            createVNode(_component_code_editor, {
              modelValue: variableCode.value,
              "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => variableCode.value = $event),
              mode: "javascript",
              "user-worker": false
            }, null, 8, ["modelValue"])
          ]),
          _: 1
        }, 8, ["modelValue"])
      ], 64);
    };
  }
};
const _sfc_main$z = {
  __name: "signature-option",
  props: propsDefinition,
  setup(__props) {
    const props2 = __props;
    const { selected, fieldConfig, formConfig } = toRefs(props2);
    return (_ctx, _cache) => {
      const _component_el_input = resolveComponent("el-input");
      const _component_el_form_item = resolveComponent("el-form-item");
      const _component_el_input_number = resolveComponent("el-input-number");
      return openBlock(), createBlock(_sfc_main$R, {
        selected: unref(selected),
        "field-config": unref(fieldConfig),
        "form-config": unref(formConfig)
      }, {
        default: withCtx(({ hideOptions }) => [
          unref(fieldConfig).penColor !== void 0 && hideOptions("penColor") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 0,
            label: "笔触颜色"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input, {
                modelValue: unref(fieldConfig).penColor,
                "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(fieldConfig).penColor = $event),
                placeholder: "#000"
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          unref(fieldConfig).backgroundColor !== void 0 && hideOptions("backgroundColor") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 1,
            label: "背景颜色"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input, {
                modelValue: unref(fieldConfig).backgroundColor,
                "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(fieldConfig).backgroundColor = $event),
                placeholder: "自定义背景颜色"
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          unref(fieldConfig).lineWidth !== void 0 && hideOptions("lineWidth") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 2,
            label: "线条宽度"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input_number, {
                modelValue: unref(fieldConfig).lineWidth,
                "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(fieldConfig).lineWidth = $event),
                min: 1,
                max: 9,
                "controls-position": "right"
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          unref(fieldConfig).clearButtonText !== void 0 && hideOptions("clearButtonText") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 3,
            label: "清除按钮"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input, {
                modelValue: unref(fieldConfig).clearButtonText,
                "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => unref(fieldConfig).clearButtonText = $event),
                placeholder: "	清空"
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          unref(fieldConfig).confirmButtonText !== void 0 && hideOptions("confirmButtonText") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 4,
            label: "确认按钮"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input, {
                modelValue: unref(fieldConfig).confirmButtonText,
                "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => unref(fieldConfig).confirmButtonText = $event),
                placeholder: "确认"
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true)
        ]),
        _: 1
      }, 8, ["selected", "field-config", "form-config"]);
    };
  }
};
const _hoisted_1$v = { class: "dialog-footer" };
const _hoisted_2$k = { class: "dialog-footer" };
const _sfc_main$y = {
  __name: "computedays-option",
  props: propsDefinition,
  setup(__props) {
    const props2 = __props;
    const { selected, widgetList, fieldConfig, formConfig } = toRefs(props2);
    const dialogHolidays = ref$1(false);
    const dialogWorkdays = ref$1(false);
    const newHolidays = ref$1(null);
    const newWorkdays = ref$1(null);
    const holidays = computed({
      get() {
        return JSON.stringify(props2.fieldConfig.holidays, null, "	");
      },
      set(value) {
        try {
          const arr = JSON.parse(value);
          if (Array.isArray(arr)) {
            newHolidays.value = arr;
          }
        } catch (error) {
          console.log(error);
        }
      }
    });
    const workdays = computed({
      get() {
        return JSON.stringify(props2.fieldConfig.workdays, null, "	");
      },
      set(value) {
        try {
          const arr = JSON.parse(value);
          if (Array.isArray(arr)) {
            newWorkdays.value = arr;
          }
        } catch (error) {
          console.log(error);
        }
      }
    });
    const saveHolidays = () => {
      if (newHolidays.value) {
        Object.assign(props2.fieldConfig, { holidays: newHolidays.value });
      }
      dialogHolidays.value = false;
    };
    const saveWorkdays = () => {
      if (newWorkdays.value) {
        Object.assign(props2.fieldConfig, { workdays: newWorkdays.value });
      }
      dialogWorkdays.value = false;
    };
    const selectList = computed(() => {
      const list = widgetList.value.filter((m) => m.type === "date");
      const cards = widgetList.value.filter((m) => m.type === "card");
      cards.forEach((e) => {
        const items = e.components.filter((m) => m.type === "date");
        list.push(...items);
      });
      return list;
    });
    return (_ctx, _cache) => {
      const _component_QuestionFilled = resolveComponent("QuestionFilled");
      const _component_el_icon = resolveComponent("el-icon");
      const _component_el_popover = resolveComponent("el-popover");
      const _component_el_option = resolveComponent("el-option");
      const _component_el_select = resolveComponent("el-select");
      const _component_el_form_item = resolveComponent("el-form-item");
      const _component_el_time_select = resolveComponent("el-time-select");
      const _component_el_col = resolveComponent("el-col");
      const _component_Edit = resolveComponent("Edit");
      const _component_el_button = resolveComponent("el-button");
      const _component_code_editor = resolveComponent("code-editor");
      const _component_el_dialog = resolveComponent("el-dialog");
      return openBlock(), createBlock(_sfc_main$R, {
        selected: unref(selected),
        "field-config": unref(fieldConfig),
        "form-config": unref(formConfig)
      }, {
        default: withCtx(({ hideOptions }) => [
          unref(fieldConfig).append !== void 0 && hideOptions("append") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 0,
            label: "计算单位"
          }, {
            label: withCtx(() => [
              createElementVNode("div", null, [
                _cache[16] || (_cache[16] = createTextVNode(" 计算单位 ")),
                createVNode(_component_el_popover, {
                  placement: "top-start",
                  title: "",
                  width: 200,
                  trigger: "hover",
                  content: "单位天，最小单位0.5天。"
                }, {
                  reference: withCtx(() => [
                    createVNode(_component_el_icon, null, {
                      default: withCtx(() => [
                        createVNode(_component_QuestionFilled)
                      ]),
                      _: 1
                    })
                  ]),
                  _: 1
                })
              ])
            ]),
            default: withCtx(() => [
              createVNode(_component_el_select, {
                modelValue: unref(fieldConfig).append,
                "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(fieldConfig).append = $event)
              }, {
                default: withCtx(() => [
                  createVNode(_component_el_option, {
                    label: "天",
                    value: "天"
                  }),
                  createVNode(_component_el_option, {
                    label: "小时",
                    value: "小时"
                  })
                ]),
                _: 1
              }, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          withDirectives(createVNode(_component_el_form_item, { label: "开始日期" }, {
            label: withCtx(() => [
              createElementVNode("div", null, [
                _cache[17] || (_cache[17] = createTextVNode(" 开始日期 ")),
                createVNode(_component_el_popover, {
                  placement: "top-start",
                  title: "",
                  width: 200,
                  trigger: "hover",
                  content: "配套两个日期组件使用，请选择开始日期组件。"
                }, {
                  reference: withCtx(() => [
                    createVNode(_component_el_icon, null, {
                      default: withCtx(() => [
                        createVNode(_component_QuestionFilled)
                      ]),
                      _: 1
                    })
                  ]),
                  _: 1
                })
              ])
            ]),
            default: withCtx(() => [
              createVNode(_component_el_select, {
                modelValue: unref(fieldConfig).selectStart,
                "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(fieldConfig).selectStart = $event),
                placeholder: "请选择开始日期"
              }, {
                default: withCtx(() => [
                  (openBlock(true), createElementBlock(Fragment, null, renderList(selectList.value, (item) => {
                    return openBlock(), createBlock(_component_el_option, {
                      key: item.options.name,
                      label: item.options.label,
                      value: item.options.name
                    }, null, 8, ["label", "value"]);
                  }), 128))
                ]),
                _: 1
              }, 8, ["modelValue"])
            ]),
            _: 2
          }, 1536), [
            [vShow, unref(fieldConfig).selectStart !== void 0 && hideOptions("selectStart")]
          ]),
          withDirectives(createVNode(_component_el_form_item, { label: "结束日期" }, {
            label: withCtx(() => [
              createElementVNode("div", null, [
                _cache[18] || (_cache[18] = createTextVNode(" 结束日期 ")),
                createVNode(_component_el_popover, {
                  placement: "top-start",
                  title: "",
                  width: 200,
                  trigger: "hover",
                  content: "配套两个日期组件使用，请选择结束日期组件。"
                }, {
                  reference: withCtx(() => [
                    createVNode(_component_el_icon, null, {
                      default: withCtx(() => [
                        createVNode(_component_QuestionFilled)
                      ]),
                      _: 1
                    })
                  ]),
                  _: 1
                })
              ])
            ]),
            default: withCtx(() => [
              createVNode(_component_el_select, {
                modelValue: unref(fieldConfig).selectEnd,
                "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(fieldConfig).selectEnd = $event),
                placeholder: "请选择结束日期"
              }, {
                default: withCtx(() => [
                  (openBlock(true), createElementBlock(Fragment, null, renderList(selectList.value, (item) => {
                    return openBlock(), createBlock(_component_el_option, {
                      key: item.options.name,
                      label: item.options.label,
                      value: item.options.name
                    }, null, 8, ["label", "value"]);
                  }), 128))
                ]),
                _: 1
              }, 8, ["modelValue"])
            ]),
            _: 2
          }, 1536), [
            [vShow, unref(fieldConfig).selectEnd !== void 0 && hideOptions("selectEnd")]
          ]),
          unref(fieldConfig).workdayMode !== void 0 && hideOptions("workdayMode") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 1,
            label: "核算方式"
          }, {
            label: withCtx(() => [
              createElementVNode("div", null, [
                _cache[19] || (_cache[19] = createTextVNode(" 核算方式 ")),
                createVNode(_component_el_popover, {
                  placement: "top-start",
                  title: "",
                  width: 200,
                  trigger: "hover",
                  content: "按工作日计算时长，仅计算有效工时。"
                }, {
                  reference: withCtx(() => [
                    createVNode(_component_el_icon, null, {
                      default: withCtx(() => [
                        createVNode(_component_QuestionFilled)
                      ]),
                      _: 1
                    })
                  ]),
                  _: 1
                })
              ])
            ]),
            default: withCtx(() => [
              createVNode(_component_el_select, {
                modelValue: unref(fieldConfig).workdayMode,
                "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => unref(fieldConfig).workdayMode = $event)
              }, {
                default: withCtx(() => [
                  createVNode(_component_el_option, {
                    label: "按自然日计算时长",
                    value: 0
                  }),
                  createVNode(_component_el_option, {
                    label: "按工作日计算时长",
                    value: 1
                  })
                ]),
                _: 1
              }, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          createVNode(_component_el_form_item, {
            label: "每日工作时间段",
            style: { "display": "flex", "align-items": "flex-start" }
          }, {
            default: withCtx(() => [
              createVNode(_component_el_col, { span: 11 }, {
                default: withCtx(() => [
                  createVNode(_component_el_time_select, {
                    modelValue: unref(fieldConfig).workTime[0].start,
                    "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => unref(fieldConfig).workTime[0].start = $event),
                    placeholder: "开始时间",
                    "max-time": unref(fieldConfig).workTime[0].end,
                    start: "06:00",
                    step: "00:10",
                    end: "20:00",
                    clearable: false,
                    "prefix-icon": ""
                  }, null, 8, ["modelValue", "max-time"])
                ]),
                _: 1
              }),
              createVNode(_component_el_col, {
                span: 2,
                style: { "display": "flex", "justify-content": "center" }
              }, {
                default: withCtx(() => _cache[20] || (_cache[20] = [
                  createElementVNode("span", { style: { "color": "#6b7280" } }, "-", -1)
                ])),
                _: 1
              }),
              createVNode(_component_el_col, { span: 11 }, {
                default: withCtx(() => [
                  createVNode(_component_el_time_select, {
                    modelValue: unref(fieldConfig).workTime[0].end,
                    "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => unref(fieldConfig).workTime[0].end = $event),
                    placeholder: "结束时间",
                    "min-time": unref(fieldConfig).workTime[0].start,
                    start: "06:00",
                    step: "00:10",
                    end: "20:00",
                    clearable: false,
                    "prefix-icon": ""
                  }, null, 8, ["modelValue", "min-time"])
                ]),
                _: 1
              }),
              _cache[22] || (_cache[22] = createElementVNode("div", { style: { "width": "100%", "height": "8px" } }, null, -1)),
              createVNode(_component_el_col, { span: 11 }, {
                default: withCtx(() => [
                  createVNode(_component_el_time_select, {
                    modelValue: unref(fieldConfig).workTime[1].start,
                    "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => unref(fieldConfig).workTime[1].start = $event),
                    placeholder: "开始时间",
                    "min-time": unref(fieldConfig).workTime[0].end,
                    "max-time": unref(fieldConfig).workTime[1].end,
                    start: "06:00",
                    step: "00:10",
                    end: "20:00",
                    clearable: false,
                    "prefix-icon": ""
                  }, null, 8, ["modelValue", "min-time", "max-time"])
                ]),
                _: 1
              }),
              createVNode(_component_el_col, {
                span: 2,
                style: { "display": "flex", "justify-content": "center" }
              }, {
                default: withCtx(() => _cache[21] || (_cache[21] = [
                  createElementVNode("span", { style: { "color": "#6b7280" } }, "-", -1)
                ])),
                _: 1
              }),
              createVNode(_component_el_col, { span: 11 }, {
                default: withCtx(() => [
                  createVNode(_component_el_time_select, {
                    modelValue: unref(fieldConfig).workTime[1].end,
                    "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => unref(fieldConfig).workTime[1].end = $event),
                    placeholder: "结束时间",
                    "min-time": unref(fieldConfig).workTime[1].start,
                    start: "06:00",
                    step: "00:10",
                    end: "20:00",
                    clearable: false,
                    "prefix-icon": ""
                  }, null, 8, ["modelValue", "min-time"])
                ]),
                _: 1
              })
            ]),
            _: 1
          }),
          createVNode(_component_el_form_item, { label: "法定节假日" }, {
            default: withCtx(() => [
              createVNode(_component_el_button, {
                type: "info",
                link: "",
                onClick: _cache[8] || (_cache[8] = ($event) => dialogHolidays.value = true)
              }, {
                default: withCtx(() => [
                  createVNode(_component_el_icon, null, {
                    default: withCtx(() => [
                      createVNode(_component_Edit)
                    ]),
                    _: 1
                  }),
                  _cache[23] || (_cache[23] = createElementVNode("span", null, "编辑", -1))
                ]),
                _: 1
              })
            ]),
            _: 1
          }),
          createVNode(_component_el_dialog, {
            modelValue: dialogHolidays.value,
            "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => dialogHolidays.value = $event),
            title: "法定节假日",
            "close-on-click-modal": false,
            "close-on-press-escape": false,
            "destroy-on-close": ""
          }, {
            footer: withCtx(() => [
              createElementVNode("span", _hoisted_1$v, [
                createVNode(_component_el_button, {
                  type: "primary",
                  onClick: saveHolidays
                }, {
                  default: withCtx(() => _cache[24] || (_cache[24] = [
                    createTextVNode("确定")
                  ])),
                  _: 1
                }),
                createVNode(_component_el_button, {
                  type: "primary",
                  onClick: _cache[10] || (_cache[10] = ($event) => dialogHolidays.value = false)
                }, {
                  default: withCtx(() => _cache[25] || (_cache[25] = [
                    createTextVNode("关闭")
                  ])),
                  _: 1
                })
              ])
            ]),
            default: withCtx(() => [
              createVNode(_component_code_editor, {
                modelValue: holidays.value,
                "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => holidays.value = $event),
                mode: "json"
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          }, 8, ["modelValue"]),
          createVNode(_component_el_form_item, { label: "调休工作日" }, {
            default: withCtx(() => [
              createVNode(_component_el_button, {
                type: "info",
                link: "",
                onClick: _cache[12] || (_cache[12] = ($event) => dialogWorkdays.value = true)
              }, {
                default: withCtx(() => [
                  createVNode(_component_el_icon, null, {
                    default: withCtx(() => [
                      createVNode(_component_Edit)
                    ]),
                    _: 1
                  }),
                  _cache[26] || (_cache[26] = createElementVNode("span", null, "编辑", -1))
                ]),
                _: 1
              })
            ]),
            _: 1
          }),
          createVNode(_component_el_dialog, {
            modelValue: dialogWorkdays.value,
            "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => dialogWorkdays.value = $event),
            title: "调休工作日",
            "close-on-click-modal": false,
            "close-on-press-escape": false,
            "destroy-on-close": ""
          }, {
            footer: withCtx(() => [
              createElementVNode("span", _hoisted_2$k, [
                createVNode(_component_el_button, {
                  type: "primary",
                  onClick: saveWorkdays
                }, {
                  default: withCtx(() => _cache[27] || (_cache[27] = [
                    createTextVNode("确定")
                  ])),
                  _: 1
                }),
                createVNode(_component_el_button, {
                  type: "primary",
                  onClick: _cache[14] || (_cache[14] = ($event) => dialogWorkdays.value = false)
                }, {
                  default: withCtx(() => _cache[28] || (_cache[28] = [
                    createTextVNode("关闭")
                  ])),
                  _: 1
                })
              ])
            ]),
            default: withCtx(() => [
              createVNode(_component_code_editor, {
                modelValue: workdays.value,
                "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => workdays.value = $event),
                mode: "json"
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          }, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["selected", "field-config", "form-config"]);
    };
  }
};
const _sfc_main$x = {
  __name: "upperamount-option",
  props: propsDefinition,
  setup(__props) {
    const props2 = __props;
    const { selected, widgetList, fieldConfig, formConfig } = toRefs(props2);
    const selectList = computed(() => {
      return widgetList.value.filter((m) => m.type === "amount");
    });
    return (_ctx, _cache) => {
      const _component_el_input = resolveComponent("el-input");
      const _component_el_form_item = resolveComponent("el-form-item");
      const _component_QuestionFilled = resolveComponent("QuestionFilled");
      const _component_el_icon = resolveComponent("el-icon");
      const _component_el_popover = resolveComponent("el-popover");
      const _component_el_option = resolveComponent("el-option");
      const _component_el_select = resolveComponent("el-select");
      return openBlock(), createBlock(_sfc_main$R, {
        selected: unref(selected),
        "field-config": unref(fieldConfig),
        "form-config": unref(formConfig)
      }, {
        default: withCtx(({ hideOptions }) => [
          unref(fieldConfig).defaultValue !== void 0 && hideOptions("defaultValue") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 0,
            label: "默认值"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input, {
                modelValue: unref(fieldConfig).defaultValue,
                "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(fieldConfig).defaultValue = $event),
                type: "text",
                maxlength: unref(fieldConfig).maxlength
              }, null, 8, ["modelValue", "maxlength"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          unref(fieldConfig).maxlength !== void 0 && hideOptions("maxlength") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 1,
            label: "长度限制"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input, {
                modelValue: unref(fieldConfig).maxlength,
                "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(fieldConfig).maxlength = $event),
                placeholder: "最大字符长度"
              }, {
                append: withCtx(() => _cache[3] || (_cache[3] = [
                  createTextVNode("个字符")
                ])),
                _: 1
              }, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true),
          withDirectives(createVNode(_component_el_form_item, { label: "金额组件" }, {
            label: withCtx(() => [
              createElementVNode("div", null, [
                _cache[4] || (_cache[4] = createTextVNode(" 金额组件 ")),
                createVNode(_component_el_popover, {
                  placement: "top-start",
                  title: "",
                  width: 200,
                  trigger: "hover",
                  content: "配套金额组件使用，请选择金额组件。"
                }, {
                  reference: withCtx(() => [
                    createVNode(_component_el_icon, null, {
                      default: withCtx(() => [
                        createVNode(_component_QuestionFilled)
                      ]),
                      _: 1
                    })
                  ]),
                  _: 1
                })
              ])
            ]),
            default: withCtx(() => [
              createVNode(_component_el_select, {
                modelValue: unref(fieldConfig).selectSumName,
                "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(fieldConfig).selectSumName = $event),
                placeholder: "请选择金额组件"
              }, {
                default: withCtx(() => [
                  (openBlock(true), createElementBlock(Fragment, null, renderList(selectList.value, (item) => {
                    return openBlock(), createBlock(_component_el_option, {
                      key: item.options.name,
                      label: item.options.label,
                      value: item.options.name
                    }, null, 8, ["label", "value"]);
                  }), 128))
                ]),
                _: 1
              }, 8, ["modelValue"])
            ]),
            _: 1
          }, 512), [
            [vShow, unref(fieldConfig).selectSumName !== void 0]
          ])
        ]),
        _: 1
      }, 8, ["selected", "field-config", "form-config"]);
    };
  }
};
const _sfc_main$w = {
  __name: "phone-option",
  props: propsDefinition,
  setup(__props) {
    const props2 = __props;
    const { selected, fieldConfig, formConfig } = toRefs(props2);
    return (_ctx, _cache) => {
      const _component_el_input = resolveComponent("el-input");
      const _component_el_form_item = resolveComponent("el-form-item");
      return openBlock(), createBlock(_sfc_main$R, {
        selected: unref(selected),
        "field-config": unref(fieldConfig),
        "form-config": unref(formConfig)
      }, {
        default: withCtx(({ hideOptions }) => [
          unref(fieldConfig).pattern !== void 0 && hideOptions("pattern") ? (openBlock(), createBlock(_component_el_form_item, {
            key: 0,
            label: "手机号校验"
          }, {
            default: withCtx(() => [
              createVNode(_component_el_input, {
                modelValue: unref(fieldConfig).pattern,
                "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(fieldConfig).pattern = $event),
                maxlength: "20",
                placeholder: "请输入校验提示"
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          })) : createCommentVNode("", true)
        ]),
        _: 1
      }, 8, ["selected", "field-config", "form-config"]);
    };
  }
};
const _sfc_main$v = {
  __name: "subform-option",
  props: propsDefinition,
  setup(__props) {
    const props2 = __props;
    const { selected, fieldConfig, formConfig } = toRefs(props2);
    return (_ctx, _cache) => {
      return openBlock(), createBlock(_sfc_main$R, {
        selected: unref(selected),
        "field-config": unref(fieldConfig),
        "form-config": unref(formConfig)
      }, {
        default: withCtx(() => _cache[0] || (_cache[0] = [])),
        _: 1
      }, 8, ["selected", "field-config", "form-config"]);
    };
  }
};
const options = {
  amountOption: _sfc_main$Q,
  inputOption: _sfc_main$P,
  textareaOption: _sfc_main$O,
  numberOption: _sfc_main$N,
  radioOption: _sfc_main$L,
  checkboxOption: _sfc_main$K,
  checkboxlistOption: _sfc_main$J,
  selectOption: _sfc_main$I,
  timeOption: _sfc_main$H,
  dateOption: _sfc_main$G,
  cascaderOption: _sfc_main$F,
  dividerOption: _sfc_main$E,
  fileuploadOption: _sfc_main$D,
  pictureOption: _sfc_main$C,
  correlationOption: _sfc_main$B,
  cardOption: _sfc_main$A,
  signatureOption: _sfc_main$z,
  computedaysOption: _sfc_main$y,
  upperamountOption: _sfc_main$x,
  phoneOption: _sfc_main$w,
  subformOption: _sfc_main$v
};
const index_vue_vue_type_style_index_0_lang$6 = "";
const _sfc_main$u = {
  components: { ...options },
  props: {
    /** 平台类型 PC/Pad/H5 */
    layoutType: {
      type: String,
      required: true
    },
    /** 容器滚动条高度 */
    height: {
      type: Number,
      default: 0
    },
    /** 表单配置 */
    formConfig: {
      type: Object,
      default: () => {
      }
    },
    /** 设计表单当前选中项 */
    selected: {
      type: Object,
      default: null
    },
    /** Json表单 */
    widgetList: {
      type: Array,
      default: null
    }
  },
  emits: ["onPermission"],
  setup(props2, { emit }) {
    const globalConfig = inject("globalConfig", {});
    const panelHeight = computed(() => {
      return props2.height + "px";
    });
    const rightTabs = ref$1("form");
    const fieldConfig = computed(() => props2.selected.options || {});
    const widgetList = computed(() => props2.widgetList || []);
    const tableData = computed(() => {
      const list = props2.widgetList.filter((m) => m.options && m.type !== "card");
      const cards = props2.widgetList.filter((m) => m.type === "card");
      cards.forEach((e) => {
        const items = e.components.filter((m) => m.options);
        list.push(...items);
      });
      return list.map((item) => {
        return {
          id: item.id || "",
          name: item.options.label || "",
          type: item.type,
          permission: 0
        };
      });
    });
    const changePermission = () => {
      const value = tableData.value.reduce((acc, item) => {
        acc[item.id] = item.permission;
        return acc;
      }, {});
      emit("onPermission", value);
    };
    watch(fieldConfig, (e) => {
      if (e.name) {
        rightTabs.value = "field";
      } else {
        rightTabs.value = "form";
      }
    });
    return {
      globalConfig,
      panelHeight,
      rightTabs,
      fieldConfig,
      widgetList,
      tableData,
      changePermission
    };
  }
};
const _hoisted_1$u = { class: "ep-setting-panel-container" };
function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_el_radio_button = resolveComponent("el-radio-button");
  const _component_el_form_item = resolveComponent("el-form-item");
  const _component_el_radio_group = resolveComponent("el-radio-group");
  const _component_el_input_number = resolveComponent("el-input-number");
  const _component_el_card = resolveComponent("el-card");
  const _component_el_divider = resolveComponent("el-divider");
  const _component_el_form = resolveComponent("el-form");
  const _component_el_tab_pane = resolveComponent("el-tab-pane");
  const _component_el_table_column = resolveComponent("el-table-column");
  const _component_el_radio = resolveComponent("el-radio");
  const _component_el_table = resolveComponent("el-table");
  const _component_el_tabs = resolveComponent("el-tabs");
  const _component_el_scrollbar = resolveComponent("el-scrollbar");
  return openBlock(), createElementBlock("div", _hoisted_1$u, [
    createVNode(_component_el_card, { shadow: "never" }, {
      default: withCtx(() => [
        createVNode(_component_el_scrollbar, {
          style: normalizeStyle({ height: $setup.panelHeight })
        }, {
          default: withCtx(() => [
            createVNode(_component_el_tabs, {
              modelValue: $setup.rightTabs,
              "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => $setup.rightTabs = $event),
              stretch: ""
            }, {
              default: withCtx(() => [
                (openBlock(), createBlock(resolveDynamicComponent(`${$props.selected.type}-option`), {
                  selected: $props.selected,
                  "widget-list": $setup.widgetList,
                  "field-config": $setup.fieldConfig,
                  "form-config": $props.formConfig
                }, null, 8, ["selected", "widget-list", "field-config", "form-config"])),
                $setup.globalConfig.formConfigShow ? (openBlock(), createBlock(_component_el_tab_pane, {
                  key: 0,
                  name: "form",
                  label: "全局"
                }, {
                  default: withCtx(() => [
                    createVNode(_component_el_form, {
                      model: $props.formConfig,
                      "label-width": "90px",
                      "label-position": "left",
                      size: "small"
                    }, {
                      default: withCtx(() => [
                        createVNode(_component_el_card, {
                          style: { "font-size": "12px" },
                          shadow: "never"
                        }, {
                          header: withCtx(() => _cache[7] || (_cache[7] = [
                            createElementVNode("div", { style: { "display": "flex", "justify-content": "space-between" } }, [
                              createElementVNode("span", null, "PC端表单设置")
                            ], -1)
                          ])),
                          default: withCtx(() => [
                            createVNode(_component_el_radio_group, {
                              modelValue: $props.formConfig.pc.size,
                              "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.formConfig.pc.size = $event),
                              class: "ep-setting-panel-container__radio-group"
                            }, {
                              default: withCtx(() => [
                                createVNode(_component_el_form_item, { label: "组件尺寸" }, {
                                  default: withCtx(() => [
                                    createVNode(_component_el_radio_button, {
                                      label: "large",
                                      value: "large"
                                    }, {
                                      default: withCtx(() => _cache[8] || (_cache[8] = [
                                        createTextVNode("大号")
                                      ])),
                                      _: 1
                                    }),
                                    createVNode(_component_el_radio_button, {
                                      label: "default",
                                      value: "default"
                                    }, {
                                      default: withCtx(() => _cache[9] || (_cache[9] = [
                                        createTextVNode("默认")
                                      ])),
                                      _: 1
                                    }),
                                    createVNode(_component_el_radio_button, {
                                      label: "small",
                                      value: "small"
                                    }, {
                                      default: withCtx(() => _cache[10] || (_cache[10] = [
                                        createTextVNode("小号")
                                      ])),
                                      _: 1
                                    })
                                  ]),
                                  _: 1
                                })
                              ]),
                              _: 1
                            }, 8, ["modelValue"]),
                            createVNode(_component_el_form_item, { label: "标签宽度" }, {
                              default: withCtx(() => [
                                createVNode(_component_el_input_number, {
                                  modelValue: $props.formConfig.pc.labelWidth,
                                  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $props.formConfig.pc.labelWidth = $event),
                                  min: 60,
                                  max: 300,
                                  "controls-position": "right"
                                }, null, 8, ["modelValue"])
                              ]),
                              _: 1
                            }),
                            createVNode(_component_el_radio_group, {
                              modelValue: $props.formConfig.pc.labelPosition,
                              "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $props.formConfig.pc.labelPosition = $event),
                              class: "ep-setting-panel-container__radio-group"
                            }, {
                              default: withCtx(() => [
                                createVNode(_component_el_form_item, { label: "标签位置" }, {
                                  default: withCtx(() => [
                                    createVNode(_component_el_radio_button, {
                                      label: "left",
                                      value: "left"
                                    }, {
                                      default: withCtx(() => _cache[11] || (_cache[11] = [
                                        createTextVNode("左侧")
                                      ])),
                                      _: 1
                                    }),
                                    createVNode(_component_el_radio_button, {
                                      label: "right",
                                      value: "right"
                                    }, {
                                      default: withCtx(() => _cache[12] || (_cache[12] = [
                                        createTextVNode("右侧")
                                      ])),
                                      _: 1
                                    }),
                                    createVNode(_component_el_radio_button, {
                                      label: "top",
                                      value: "top"
                                    }, {
                                      default: withCtx(() => _cache[13] || (_cache[13] = [
                                        createTextVNode("顶部")
                                      ])),
                                      _: 1
                                    })
                                  ]),
                                  _: 1
                                })
                              ]),
                              _: 1
                            }, 8, ["modelValue"])
                          ]),
                          _: 1
                        }),
                        createVNode(_component_el_divider),
                        createVNode(_component_el_card, {
                          style: { "font-size": "12px" },
                          shadow: "never"
                        }, {
                          header: withCtx(() => _cache[14] || (_cache[14] = [
                            createElementVNode("div", { style: { "display": "flex", "justify-content": "space-between" } }, [
                              createElementVNode("span", null, "H5端表单设置")
                            ], -1)
                          ])),
                          default: withCtx(() => [
                            createVNode(_component_el_form_item, { label: "标签宽度" }, {
                              default: withCtx(() => [
                                createVNode(_component_el_input_number, {
                                  modelValue: $props.formConfig.h5.labelWidth,
                                  "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $props.formConfig.h5.labelWidth = $event),
                                  min: 60,
                                  max: 300,
                                  "controls-position": "right"
                                }, null, 8, ["modelValue"])
                              ]),
                              _: 1
                            }),
                            createVNode(_component_el_radio_group, {
                              modelValue: $props.formConfig.h5.labelPosition,
                              "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $props.formConfig.h5.labelPosition = $event),
                              class: "ep-setting-panel-container__radio-group"
                            }, {
                              default: withCtx(() => [
                                createVNode(_component_el_form_item, { label: "标签位置" }, {
                                  default: withCtx(() => [
                                    createVNode(_component_el_radio_button, {
                                      label: "left",
                                      value: "left"
                                    }, {
                                      default: withCtx(() => _cache[15] || (_cache[15] = [
                                        createTextVNode("左侧")
                                      ])),
                                      _: 1
                                    }),
                                    createVNode(_component_el_radio_button, {
                                      label: "right",
                                      value: "right"
                                    }, {
                                      default: withCtx(() => _cache[16] || (_cache[16] = [
                                        createTextVNode("右侧")
                                      ])),
                                      _: 1
                                    }),
                                    createVNode(_component_el_radio_button, {
                                      label: "top",
                                      value: "top"
                                    }, {
                                      default: withCtx(() => _cache[17] || (_cache[17] = [
                                        createTextVNode("顶部")
                                      ])),
                                      _: 1
                                    })
                                  ]),
                                  _: 1
                                })
                              ]),
                              _: 1
                            }, 8, ["modelValue"]),
                            createVNode(_component_el_radio_group, {
                              modelValue: $props.formConfig.h5.inputAlign,
                              "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => $props.formConfig.h5.inputAlign = $event),
                              class: "ep-setting-panel-container__radio-group"
                            }, {
                              default: withCtx(() => [
                                createVNode(_component_el_form_item, { label: "输入框位置" }, {
                                  default: withCtx(() => [
                                    createVNode(_component_el_radio_button, {
                                      label: "left",
                                      value: "left"
                                    }, {
                                      default: withCtx(() => _cache[18] || (_cache[18] = [
                                        createTextVNode("左侧")
                                      ])),
                                      _: 1
                                    }),
                                    createVNode(_component_el_radio_button, {
                                      label: "center",
                                      value: "top"
                                    }, {
                                      default: withCtx(() => _cache[19] || (_cache[19] = [
                                        createTextVNode("居中")
                                      ])),
                                      _: 1
                                    }),
                                    createVNode(_component_el_radio_button, {
                                      label: "right",
                                      value: "right"
                                    }, {
                                      default: withCtx(() => _cache[20] || (_cache[20] = [
                                        createTextVNode("右侧")
                                      ])),
                                      _: 1
                                    })
                                  ]),
                                  _: 1
                                })
                              ]),
                              _: 1
                            }, 8, ["modelValue"])
                          ]),
                          _: 1
                        })
                      ]),
                      _: 1
                    }, 8, ["model"])
                  ]),
                  _: 1
                })) : createCommentVNode("", true),
                $setup.globalConfig.permissionShow ? (openBlock(), createBlock(_component_el_tab_pane, {
                  key: 1,
                  name: "test",
                  label: "权限"
                }, {
                  default: withCtx(() => [
                    createVNode(_component_el_table, {
                      data: $setup.tableData,
                      class: "custom-border",
                      size: "small"
                    }, {
                      default: withCtx(() => [
                        createVNode(_component_el_table_column, {
                          prop: "name",
                          label: "字段"
                        }),
                        createVNode(_component_el_table_column, {
                          label: "显示",
                          width: "60",
                          align: "center"
                        }, {
                          default: withCtx((scope) => [
                            createVNode(_component_el_radio_group, {
                              modelValue: scope.row.permission,
                              "onUpdate:modelValue": ($event) => scope.row.permission = $event,
                              size: "large",
                              onChange: $setup.changePermission
                            }, {
                              default: withCtx(() => [
                                createVNode(_component_el_radio, { value: 0 })
                              ]),
                              _: 2
                            }, 1032, ["modelValue", "onUpdate:modelValue", "onChange"])
                          ]),
                          _: 1
                        }),
                        createVNode(_component_el_table_column, {
                          label: "只读",
                          width: "60",
                          align: "center"
                        }, {
                          default: withCtx((scope) => [
                            createVNode(_component_el_radio_group, {
                              modelValue: scope.row.permission,
                              "onUpdate:modelValue": ($event) => scope.row.permission = $event,
                              size: "large",
                              onChange: $setup.changePermission
                            }, {
                              default: withCtx(() => [
                                createVNode(_component_el_radio, { value: 1 })
                              ]),
                              _: 2
                            }, 1032, ["modelValue", "onUpdate:modelValue", "onChange"])
                          ]),
                          _: 1
                        }),
                        createVNode(_component_el_table_column, {
                          label: "隐藏",
                          width: "60",
                          align: "center"
                        }, {
                          default: withCtx((scope) => [
                            createVNode(_component_el_radio_group, {
                              modelValue: scope.row.permission,
                              "onUpdate:modelValue": ($event) => scope.row.permission = $event,
                              size: "large",
                              onChange: $setup.changePermission
                            }, {
                              default: withCtx(() => [
                                createVNode(_component_el_radio, { value: 2 })
                              ]),
                              _: 2
                            }, 1032, ["modelValue", "onUpdate:modelValue", "onChange"])
                          ]),
                          _: 1
                        })
                      ]),
                      _: 1
                    }, 8, ["data"])
                  ]),
                  _: 1
                })) : createCommentVNode("", true)
              ]),
              _: 1
            }, 8, ["modelValue"])
          ]),
          _: 1
        }, 8, ["style"])
      ]),
      _: 1
    })
  ]);
}
const SettingPanel = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_render$t]]);
const props = {
  /** 是否渲染H5 UI组件 */
  h5: {
    type: Boolean,
    default: false
  },
  /** 组件列表 */
  widgetList: {
    type: Array,
    default: []
  },
  /** 组件配置项 */
  item: {
    type: Object,
    default: {}
  },
  /** 索引位置 */
  index: {
    type: Number,
    default: 0
  },
  /** 是否设计器中展示 */
  designer: {
    type: Boolean,
    default: false
  },
  /** 组件绑定值 */
  modelValue: {
    type: [String, Number, Array, Date],
    default: null
  },
  /** 表单数据，表单组件中使用 */
  formData: {
    type: Object,
    default: null
  },
  /** 详情页中展示 */
  detail: {
    type: Boolean,
    default: false
  }
};
const _sfc_main$t = {
  name: "MAmount",
  props,
  emits: ["update:modelValue"],
  setup(props2, { emit }) {
    const fieldModel = computed({
      get() {
        return props2.modelValue;
      },
      set(val) {
        if (!props2.designer) {
          emit("update:modelValue", val);
        }
      }
    });
    const isDetail = computed(() => {
      if (props2.detail) {
        return true;
      }
      return props2.item.permission > 0;
    });
    const rules = reactive([
      {
        required: !props2.item.options.hidden && !props2.item.options.readonly && props2.item.options.required,
        message: props2.h5 ? "" : props2.item.options.requiredMessage,
        trigger: "change"
      }
    ]);
    const handleBlurEvent = (value) => {
      const limitMin = props2.item.options.min || 0;
      const limitMax = props2.item.options.max || 999999999999999;
      if (value > limitMax) {
        emit("update:modelValue", limitMax);
      }
      if (value < limitMin) {
        emit("update:modelValue", limitMin);
      }
      if (props2.item.options.omitEndZero && String(value).indexOf(".") !== -1) {
        const filtered = String(value).replace(/\.?0*$/, "");
        if (filtered !== String(value)) {
          emit("update:modelValue", filtered);
        }
      }
    };
    const formatter = (value) => {
      let filtered = value.replace(/[^\d.]/g, "").replace(/^0+(\d)/, "$1").replace(/(\..*)\./g, "$1");
      if (props2.item.options.decimalPlaces === 2) {
        filtered = filtered.replace(/(\.\d{2})\d+/g, "$1");
      } else {
        filtered = filtered.replace(/(\.\d)\d+/g, "$1");
      }
      return filtered;
    };
    const handleInput = (value) => {
      let filtered = value.replace(/[^\d.]/g, "").replace(/^0+(\d)/, "$1").replace(/(\..*)\./g, "$1");
      if (props2.item.options.decimalPlaces === 2) {
        filtered = filtered.replace(/(\.\d{2})\d+/g, "$1");
      } else {
        filtered = filtered.replace(/(\.\d)\d+/g, "$1");
      }
      if (filtered !== value) {
        emit("update:modelValue", filtered);
      }
    };
    return {
      fieldModel,
      isDetail,
      rules,
      formatter,
      handleInput,
      handleBlurEvent
    };
  }
};
const _hoisted_1$t = { key: 1 };
function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
  var _a2;
  const _component_van_field = resolveComponent("van-field");
  const _component_el_input = resolveComponent("el-input");
  const _component_widget_form_item = resolveComponent("widget-form-item");
  return _ctx.h5 ? withDirectives((openBlock(), createBlock(_component_van_field, {
    key: 0,
    modelValue: $setup.fieldModel,
    "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.fieldModel = $event),
    type: "number",
    formatter: $setup.formatter,
    name: _ctx.item.options && _ctx.item.options.name,
    label: _ctx.item.options && _ctx.item.options.label,
    readonly: $setup.isDetail || _ctx.designer || _ctx.item.options && _ctx.item.options.readonly,
    placeholder: $setup.isDetail ? "" : _ctx.item.options && _ctx.item.options.placeholder,
    required: _ctx.item.options && !$setup.isDetail && _ctx.item.options.required,
    rules: $setup.isDetail ? [] : $setup.rules,
    border: false,
    "label-width": ((_a2 = _ctx.item.options) == null ? void 0 : _a2.labelPosition) === "top" ? "100%" : void 0,
    "label-align": _ctx.item.options && _ctx.item.options.labelPosition || void 0,
    "input-align": _ctx.item.options && _ctx.item.options.inputAlign || void 0,
    autocomplete: "off",
    onBlur: _cache[1] || (_cache[1] = ($event) => $setup.handleBlurEvent($setup.fieldModel))
  }, null, 8, ["modelValue", "formatter", "name", "label", "readonly", "placeholder", "required", "rules", "label-width", "label-align", "input-align"])), [
    [vShow, _ctx.designer || _ctx.item.options && !_ctx.item.options.hidden]
  ]) : withDirectives((openBlock(), createBlock(_component_widget_form_item, {
    key: 1,
    designer: _ctx.designer,
    "widget-list": _ctx.widgetList,
    item: _ctx.item,
    rules: $setup.isDetail ? [] : $setup.rules,
    index: _ctx.index,
    "show-message": !$setup.isDetail
  }, {
    default: withCtx(() => [
      !$setup.isDetail ? (openBlock(), createBlock(_component_el_input, {
        key: 0,
        modelValue: $setup.fieldModel,
        "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.fieldModel = $event),
        type: "text",
        readonly: _ctx.designer || _ctx.item.options && _ctx.item.options.readonly,
        placeholder: _ctx.item.options && _ctx.item.options.placeholder,
        min: _ctx.item.options && _ctx.item.options.min,
        max: _ctx.item.options && _ctx.item.options.max,
        onInput: $setup.handleInput,
        onBlur: _cache[3] || (_cache[3] = ($event) => $setup.handleBlurEvent($setup.fieldModel))
      }, null, 8, ["modelValue", "readonly", "placeholder", "min", "max", "onInput"])) : (openBlock(), createElementBlock("div", _hoisted_1$t, toDisplayString($setup.fieldModel), 1))
    ]),
    _: 1
  }, 8, ["designer", "widget-list", "item", "rules", "index", "show-message"])), [
    [vShow, _ctx.designer || _ctx.item.options && !_ctx.item.options.hidden]
  ]);
}
const mAmount = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$s]]);
const init = (props2, emit) => {
  const isDetail = computed(() => {
    if (props2.detail) {
      return true;
    }
    return props2.item.permission > 0;
  });
  const fieldModel = computed({
    get() {
      if (isDetail.value && !props2.modelValue) {
        if (props2.item.type === "number" || props2.item.type === "computedays") {
          return "0";
        }
        if (!props2.item.options.append) {
          return "--";
        }
      }
      return props2.modelValue;
    },
    set(val) {
      if (!props2.designer) {
        emit("update:modelValue", val);
      }
    }
  });
  watch(
    () => props2.item.options.defaultValue,
    (val) => {
      if (!props2.modelValue) {
        fieldModel.value = val;
      }
      if (Array.isArray(props2.modelValue) && props2.modelValue.length === 0) {
        fieldModel.value = val;
      }
      if (props2.designer) {
        emit("update:modelValue", val);
      }
    },
    { immediate: true }
  );
  let rules = reactive([
    {
      required: !props2.item.options.hidden && !props2.item.options.readonly && props2.item.options.required,
      message: props2.h5 ? "" : props2.item.options.requiredMessage,
      trigger: "blur"
    }
  ]);
  const events = computed(() => props2.item.events || {});
  const { onChange, onFocus, onBlur, onValidate } = events.value;
  if (onValidate && !props2.item.options.hidden && !props2.item.options.readonly) {
    if (props2.h5) {
      const customFn = (value) => {
        return new Promise((resolve) => {
          const validateFn = new Function("value", "formData", "callback", onValidate);
          let errorMsg = true;
          const callback = (msg) => {
            if (msg) {
              errorMsg = msg;
            }
            resolve(errorMsg);
          };
          validateFn(value, props2.formData, callback);
        });
      };
      rules.push({
        validator: customFn
      });
    } else {
      const customFn = (rule, value, callback) => {
        const validateFn = new Function("value", "formData", "callback", onValidate);
        const _callback = (msg) => {
          if (msg) {
            callback(new Error(msg));
          }
          callback();
        };
        validateFn(value, props2.formData, _callback);
      };
      rules.push({
        validator: customFn,
        trigger: ["blur", "change"]
      });
    }
  }
  const handleChangeEvent = (val) => {
    if (onChange) {
      const changeFn = new Function("value", "formData", onChange);
      changeFn(val, props2.formData);
    }
  };
  const handleBlurEvent = (event) => {
    if (onFocus) {
      const blurFn = new Function("event", onFocus);
      blurFn(event);
    }
  };
  const handleFocusEvent = (event) => {
    if (onBlur) {
      const focusFn = new Function("event", onBlur);
      focusFn(event);
    }
  };
  watch(
    () => props2.modelValue,
    (val) => {
      handleChangeEvent(val);
    }
  );
  if (props2.designer) {
    rules = reactive([]);
  }
  return {
    isDetail,
    fieldModel,
    rules,
    handleBlurEvent,
    handleFocusEvent
  };
};
const _sfc_main$s = {
  name: "MCard",
  props,
  emits: ["update:modelValue"],
  setup(props2, { emit }) {
    return init(props2, emit);
  }
};
const _hoisted_1$s = { key: 0 };
function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_widget_form_item = resolveComponent("widget-form-item");
  return _ctx.h5 ? (openBlock(), createElementBlock("div", _hoisted_1$s, [
    renderSlot(_ctx.$slots, "default", {
      components: _ctx.item.components
    })
  ])) : (openBlock(), createBlock(_component_widget_form_item, {
    key: 1,
    designer: _ctx.designer,
    "widget-list": _ctx.widgetList,
    item: _ctx.item,
    index: _ctx.index
  }, {
    default: withCtx(() => [
      renderSlot(_ctx.$slots, "default", {
        components: _ctx.item.components
      })
    ]),
    _: 3
  }, 8, ["designer", "widget-list", "item", "index"]));
}
const mCard = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$r]]);
const _sfc_main$r = {
  name: "MCascader",
  props,
  emits: ["update:modelValue"],
  setup(props2, { emit }) {
    const showPicker = ref$1(false);
    const cascaderValue = ref$1("");
    const fieldNames = {
      text: "label",
      value: "value",
      children: "children"
    };
    const findDepartmentPath = (items, values) => {
      for (const item of items) {
        if (item.value === values[0]) {
          if (values.length === 1) {
            return item.label;
          } else if (item.children) {
            const childPath = findDepartmentPath(item.children, values.slice(1));
            if (childPath) {
              return `${item.label} / ${childPath}`;
            }
          }
        }
      }
      return "";
    };
    const modelValueText = computed(() => {
      if (props2.modelValue) {
        return findDepartmentPath(props2.item.options.optionItems, props2.modelValue);
      }
      return "";
    });
    const onShowPicker = () => {
      const { isDetail } = init(props2, emit);
      if (!props2.item.options.readonly && !props2.item.options.disabled && !isDetail.value) {
        showPicker.value = true;
      }
    };
    const onFinish = ({ selectedOptions }) => {
      emit(
        "update:modelValue",
        selectedOptions.map((x) => x.value)
      );
      showPicker.value = false;
    };
    return {
      showPicker,
      modelValueText,
      cascaderValue,
      fieldNames,
      onFinish,
      onShowPicker,
      ...init(props2, emit)
    };
  }
};
const _hoisted_1$r = { key: 1 };
function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_van_field = resolveComponent("van-field");
  const _component_el_cascader = resolveComponent("el-cascader");
  const _component_widget_form_item = resolveComponent("widget-form-item");
  const _component_van_cascader = resolveComponent("van-cascader");
  const _component_van_popup = resolveComponent("van-popup");
  return openBlock(), createElementBlock(Fragment, null, [
    _ctx.h5 ? (openBlock(), createBlock(_component_van_field, {
      key: 0,
      "model-value": $setup.modelValueText,
      "is-link": !_ctx.isDetail,
      readonly: "",
      name: _ctx.item.options && _ctx.item.options.name,
      label: _ctx.item.options && _ctx.item.options.label,
      disabled: _ctx.item.options && _ctx.item.options.disabled,
      placeholder: _ctx.item.options && _ctx.item.options.placeholder,
      clearable: _ctx.item.options && _ctx.item.options.clearable,
      required: _ctx.item.options && !_ctx.isDetail && _ctx.item.options.required,
      rules: _ctx.isDetail ? [] : _ctx.rules,
      border: false,
      "label-align": _ctx.item.options && _ctx.item.options.labelPosition || void 0,
      "input-align": _ctx.item.options && _ctx.item.options.inputAlign || void 0,
      onClick: $setup.onShowPicker
    }, null, 8, ["model-value", "is-link", "name", "label", "disabled", "placeholder", "clearable", "required", "rules", "label-align", "input-align", "onClick"])) : (openBlock(), createBlock(_component_widget_form_item, {
      key: 1,
      designer: _ctx.designer,
      "widget-list": _ctx.widgetList,
      item: _ctx.item,
      rules: _ctx.isDetail ? [] : _ctx.rules,
      index: _ctx.index,
      "show-message": !_ctx.isDetail
    }, {
      default: withCtx(() => [
        !_ctx.isDetail ? (openBlock(), createBlock(_component_el_cascader, {
          key: 0,
          modelValue: _ctx.fieldModel,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.fieldModel = $event),
          style: { "flex": "1" },
          options: _ctx.item.options.optionItems,
          props: { expandTrigger: "hover" },
          disabled: _ctx.item.options && _ctx.item.options.disabled,
          placeholder: _ctx.item.options && _ctx.item.options.placeholder,
          clearable: _ctx.item.options && _ctx.item.options.clearable
        }, null, 8, ["modelValue", "options", "disabled", "placeholder", "clearable"])) : (openBlock(), createElementBlock("div", _hoisted_1$r, toDisplayString($setup.modelValueText), 1))
      ]),
      _: 1
    }, 8, ["designer", "widget-list", "item", "rules", "index", "show-message"])),
    createVNode(_component_van_popup, {
      show: $setup.showPicker,
      "onUpdate:show": _cache[3] || (_cache[3] = ($event) => $setup.showPicker = $event),
      round: "",
      position: "bottom"
    }, {
      default: withCtx(() => [
        createVNode(_component_van_cascader, {
          modelValue: $setup.cascaderValue,
          "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.cascaderValue = $event),
          title: _ctx.item.options.label,
          options: _ctx.item.options.optionItems,
          "field-names": $setup.fieldNames,
          onClose: _cache[2] || (_cache[2] = ($event) => $setup.showPicker = false),
          onFinish: $setup.onFinish
        }, null, 8, ["modelValue", "title", "options", "field-names", "onFinish"])
      ]),
      _: 1
    }, 8, ["show"])
  ], 64);
}
const mCascader = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$q]]);
const checkboxProps = _.defaultsDeep(
  {
    modelValue: {
      type: Array,
      default: []
    }
  },
  props
);
const _sfc_main$q = {
  name: "MCheckbox",
  props: checkboxProps,
  emits: ["update:modelValue"],
  setup(props2, { emit }) {
    const fieldModel = computed({
      get() {
        return props2.modelValue;
      },
      set(val) {
        emit("update:modelValue", val);
      }
    });
    const fieldModelText = computed(() => {
      if (Array.isArray(props2.item.options.optionItems) && Array.isArray(fieldModel.value) && fieldModel.value.length > 0) {
        const options2 = props2.item.options.optionItems.filter((x) => fieldModel.value.includes(x.value)).map((x) => x.label);
        return options2.join(", ");
      }
      return "--";
    });
    return {
      ...init(props2, emit),
      fieldModelText
    };
  }
};
const _hoisted_1$q = { key: 1 };
const _hoisted_2$j = { key: 1 };
function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
  var _a2;
  const _component_van_checkbox = resolveComponent("van-checkbox");
  const _component_van_checkbox_group = resolveComponent("van-checkbox-group");
  const _component_van_field = resolveComponent("van-field");
  const _component_el_checkbox = resolveComponent("el-checkbox");
  const _component_el_checkbox_group = resolveComponent("el-checkbox-group");
  const _component_widget_form_item = resolveComponent("widget-form-item");
  return _ctx.h5 ? (openBlock(), createBlock(_component_van_field, {
    key: 0,
    name: _ctx.item.options && _ctx.item.options.name,
    label: _ctx.item.options && _ctx.item.options.label,
    required: _ctx.item.options && !_ctx.isDetail && _ctx.item.options.required,
    rules: _ctx.isDetail ? [] : _ctx.rules,
    border: false,
    "label-width": ((_a2 = _ctx.item.options) == null ? void 0 : _a2.labelPosition) === "top" ? "100%" : void 0,
    "label-align": _ctx.item.options && _ctx.item.options.labelPosition || void 0,
    "input-align": _ctx.item.options && _ctx.item.options.inputAlign || void 0,
    autocomplete: "off"
  }, {
    input: withCtx(() => [
      !_ctx.isDetail ? (openBlock(), createBlock(_component_van_checkbox_group, {
        key: 0,
        modelValue: _ctx.fieldModel,
        "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.fieldModel = $event),
        disabled: _ctx.isDetail || _ctx.item.options && _ctx.item.options.disabled,
        direction: _ctx.item.options && _ctx.item.options.inline ? "horizontal" : "vertical"
      }, {
        default: withCtx(() => [
          (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.item.options.optionItems, (r, i) => {
            return openBlock(), createBlock(_component_van_checkbox, {
              key: i,
              name: r.value,
              disabled: r.disabled,
              style: { "margin": "6px 12px" }
            }, {
              default: withCtx(() => [
                createTextVNode(toDisplayString(r.label), 1)
              ]),
              _: 2
            }, 1032, ["name", "disabled"]);
          }), 128))
        ]),
        _: 1
      }, 8, ["modelValue", "disabled", "direction"])) : (openBlock(), createElementBlock("div", _hoisted_1$q, toDisplayString($setup.fieldModelText), 1))
    ]),
    _: 1
  }, 8, ["name", "label", "required", "rules", "label-width", "label-align", "input-align"])) : (openBlock(), createBlock(_component_widget_form_item, {
    key: 1,
    designer: _ctx.designer,
    "widget-list": _ctx.widgetList,
    item: _ctx.item,
    rules: _ctx.isDetail ? [] : _ctx.rules,
    index: _ctx.index,
    "show-message": !_ctx.isDetail
  }, {
    default: withCtx(() => [
      !_ctx.isDetail ? (openBlock(), createBlock(_component_el_checkbox_group, {
        key: 0,
        modelValue: _ctx.fieldModel,
        "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.fieldModel = $event),
        disabled: _ctx.isDetail || _ctx.item.options && _ctx.item.options.disabled
      }, {
        default: withCtx(() => [
          (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.item.options.optionItems, (r, i) => {
            return openBlock(), createBlock(_component_el_checkbox, {
              key: i,
              label: r.value,
              value: r.value,
              disabled: r.disabled,
              style: normalizeStyle({ width: _ctx.item.options.inline ? "auto" : "100%" })
            }, {
              default: withCtx(() => [
                createTextVNode(toDisplayString(r.label), 1)
              ]),
              _: 2
            }, 1032, ["label", "value", "disabled", "style"]);
          }), 128))
        ]),
        _: 1
      }, 8, ["modelValue", "disabled"])) : (openBlock(), createElementBlock("div", _hoisted_2$j, toDisplayString($setup.fieldModelText), 1))
    ]),
    _: 1
  }, 8, ["designer", "widget-list", "item", "rules", "index", "show-message"]));
}
const mCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$p]]);
const mCheckboxlist_vue_vue_type_style_index_0_scoped_4339b526_lang = "";
const checkboxlistProps = _.defaultsDeep(
  {
    modelValue: {
      type: Array,
      default: []
    }
  },
  props
);
const _sfc_main$p = {
  name: "MCheckboxList",
  props: checkboxlistProps,
  emits: ["update:modelValue"],
  setup(props2, { emit }) {
    const showPicker = ref$1(false);
    const customFieldName = {
      text: "label",
      children: "children"
    };
    const options2 = computed(() => props2.item.options);
    const isDetail = computed(() => {
      if (props2.detail) {
        return true;
      }
      return props2.item.permission > 0;
    });
    const fieldModel = computed({
      get() {
        console.log("props.modelValue :>> ", props2.modelValue);
        return props2.modelValue;
      },
      set(val) {
        emit("update:modelValue", val);
      }
    });
    const fieldModelText = computed(() => {
      if (Array.isArray(props2.item.options.optionItems) && Array.isArray(fieldModel.value) && fieldModel.value.length > 0) {
        const options3 = props2.item.options.optionItems.filter((x) => fieldModel.value.includes(x.value)).map((x) => x.label);
        return options3.join(", ");
      }
      return isDetail.value ? "--" : "";
    });
    const onConfirm = () => {
      showPicker.value = false;
    };
    const onShowPicker = () => {
      if (!options2.value.readonly && !options2.value.disabled && !isDetail.value) {
        showPicker.value = true;
      }
    };
    const onChange = (val) => {
      emit("update:modelValue", val);
    };
    const onRemoveTag = (tag) => {
      const val = props2.modelValue.filter((v) => v !== tag);
      emit("update:modelValue", val);
    };
    return {
      ...init(props2, emit),
      showPicker,
      customFieldName,
      fieldModelText,
      onConfirm,
      onShowPicker,
      onChange,
      onRemoveTag
    };
  }
};
const _hoisted_1$p = { key: 1 };
const _hoisted_2$i = {
  key: 1,
  style: { "overflow": "hidden", "flex": "1" }
};
const _hoisted_3$d = { class: "van-action-sheet__description" };
const _hoisted_4$9 = { class: "van-action-sheet__content" };
const _hoisted_5$7 = { class: "popup-content" };
const _hoisted_6$5 = { class: "van-hairline--top van-dialog__footer" };
function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
  var _a2;
  const _component_van_text_ellipsis = resolveComponent("van-text-ellipsis");
  const _component_van_field = resolveComponent("van-field");
  const _component_el_checkbox = resolveComponent("el-checkbox");
  const _component_el_option = resolveComponent("el-option");
  const _component_el_checkbox_group = resolveComponent("el-checkbox-group");
  const _component_el_select = resolveComponent("el-select");
  const _component_el_text = resolveComponent("el-text");
  const _component_widget_form_item = resolveComponent("widget-form-item");
  const _component_van_checkbox = resolveComponent("van-checkbox");
  const _component_van_checkbox_group = resolveComponent("van-checkbox-group");
  const _component_van_popup = resolveComponent("van-popup");
  return openBlock(), createElementBlock(Fragment, null, [
    _ctx.h5 ? (openBlock(), createBlock(_component_van_field, {
      key: 0,
      "model-value": $setup.fieldModelText,
      "is-link": !_ctx.isDetail,
      readonly: "",
      name: _ctx.item.options && _ctx.item.options.name,
      label: _ctx.item.options && _ctx.item.options.label,
      disabled: _ctx.item.options && _ctx.item.options.disabled,
      placeholder: _ctx.isDetail ? "" : _ctx.item.options && _ctx.item.options.placeholder,
      clearable: _ctx.item.options && _ctx.item.options.clearable,
      required: _ctx.item.options && !_ctx.isDetail && _ctx.item.options.required,
      rules: _ctx.isDetail ? [] : _ctx.rules,
      border: false,
      "label-width": ((_a2 = _ctx.item.options) == null ? void 0 : _a2.labelPosition) === "top" ? "100%" : void 0,
      "label-align": _ctx.item.options && _ctx.item.options.labelPosition || void 0,
      "input-align": _ctx.item.options && _ctx.item.options.inputAlign || void 0,
      onClick: $setup.onShowPicker
    }, createSlots({ _: 2 }, [
      $setup.fieldModelText ? {
        name: "input",
        fn: withCtx(() => [
          _ctx.item.options.ellipsis ? (openBlock(), createBlock(_component_van_text_ellipsis, {
            key: 0,
            content: $setup.fieldModelText,
            style: { "width": "100%" }
          }, null, 8, ["content"])) : (openBlock(), createElementBlock("div", _hoisted_1$p, toDisplayString($setup.fieldModelText), 1))
        ]),
        key: "0"
      } : void 0
    ]), 1032, ["model-value", "is-link", "name", "label", "disabled", "placeholder", "clearable", "required", "rules", "label-width", "label-align", "input-align", "onClick"])) : (openBlock(), createBlock(_component_widget_form_item, {
      key: 1,
      designer: _ctx.designer,
      "widget-list": _ctx.widgetList,
      item: _ctx.item,
      rules: _ctx.isDetail ? [] : _ctx.rules,
      index: _ctx.index,
      "show-message": !_ctx.isDetail
    }, {
      default: withCtx(() => [
        !_ctx.isDetail ? (openBlock(), createBlock(_component_el_select, {
          key: 0,
          "model-value": _ctx.fieldModel,
          "value-key": "value",
          style: { "flex": "1" },
          multiple: "",
          "collapse-tags": _ctx.item.options && _ctx.item.options.collapseTags,
          "collapse-tags-tooltip": _ctx.item.options && _ctx.item.options.collapseTags,
          "max-collapse-tags": _ctx.item.options && _ctx.item.options.maxCollapseTags,
          disabled: _ctx.item.options && _ctx.item.options.disabled,
          placeholder: _ctx.item.options && _ctx.item.options.placeholder,
          clearable: _ctx.item.options && _ctx.item.options.clearable,
          onChange: $setup.onChange,
          onRemoveTag: $setup.onRemoveTag
        }, {
          default: withCtx(() => [
            createVNode(_component_el_checkbox_group, {
              modelValue: _ctx.fieldModel,
              "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.fieldModel = $event)
            }, {
              default: withCtx(() => [
                (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.item.options.optionItems, (r, i) => {
                  return openBlock(), createBlock(_component_el_option, {
                    key: i,
                    label: r.label,
                    value: r.value,
                    disabled: r.disabled
                  }, {
                    default: withCtx(() => [
                      createVNode(_component_el_checkbox, {
                        label: r.label,
                        value: r.value,
                        disabled: r.disabled,
                        style: { "pointer-events": "none" }
                      }, null, 8, ["label", "value", "disabled"])
                    ]),
                    _: 2
                  }, 1032, ["label", "value", "disabled"]);
                }), 128))
              ]),
              _: 1
            }, 8, ["modelValue"])
          ]),
          _: 1
        }, 8, ["model-value", "collapse-tags", "collapse-tags-tooltip", "max-collapse-tags", "disabled", "placeholder", "clearable", "onChange", "onRemoveTag"])) : (openBlock(), createElementBlock("div", _hoisted_2$i, [
          createVNode(_component_el_text, {
            truncated: _ctx.item.options.ellipsis
          }, {
            default: withCtx(() => [
              createTextVNode(toDisplayString($setup.fieldModelText), 1)
            ]),
            _: 1
          }, 8, ["truncated"])
        ]))
      ]),
      _: 1
    }, 8, ["designer", "widget-list", "item", "rules", "index", "show-message"])),
    createVNode(_component_van_popup, {
      show: $setup.showPicker,
      "onUpdate:show": _cache[4] || (_cache[4] = ($event) => $setup.showPicker = $event),
      round: "",
      position: "bottom"
    }, {
      default: withCtx(() => [
        createElementVNode("div", _hoisted_3$d, toDisplayString(_ctx.item.options.label), 1),
        createElementVNode("div", _hoisted_4$9, [
          createElementVNode("div", _hoisted_5$7, [
            createVNode(_component_van_checkbox_group, {
              modelValue: _ctx.fieldModel,
              "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.fieldModel = $event),
              direction: "horizontal"
            }, {
              default: withCtx(() => [
                (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.item.options.optionItems, (r) => {
                  return openBlock(), createBlock(_component_van_checkbox, {
                    key: r.value,
                    name: r.value,
                    class: normalizeClass(_ctx.fieldModel.includes(r.value) ? "checkbox-active" : "")
                  }, {
                    default: withCtx(() => [
                      createTextVNode(toDisplayString(r.label), 1)
                    ]),
                    _: 2
                  }, 1032, ["name", "class"]);
                }), 128))
              ]),
              _: 1
            }, 8, ["modelValue"])
          ])
        ]),
        _cache[7] || (_cache[7] = createElementVNode("div", { class: "van-action-sheet__gap" }, null, -1)),
        createElementVNode("div", _hoisted_6$5, [
          createElementVNode("button", {
            type: "button",
            class: "van-action-sheet__cancel van-dialog__cancel",
            onClick: _cache[2] || (_cache[2] = ($event) => $setup.showPicker = false)
          }, _cache[5] || (_cache[5] = [
            createElementVNode("div", { class: "van-button__content" }, [
              createElementVNode("span", { class: "van-button__text" }, "取消")
            ], -1)
          ])),
          createElementVNode("button", {
            type: "button",
            class: "van-action-sheet__cancel van-dialog__confirm van-hairline--left",
            onClick: _cache[3] || (_cache[3] = (...args) => $setup.onConfirm && $setup.onConfirm(...args))
          }, _cache[6] || (_cache[6] = [
            createElementVNode("div", { class: "van-button__content" }, [
              createElementVNode("span", { class: "van-button__text" }, "确认")
            ], -1)
          ]))
        ])
      ]),
      _: 1
    }, 8, ["show"])
  ], 64);
}
const mCheckboxlist = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$o], ["__scopeId", "data-v-4339b526"]]);
const mCorrelation_vue_vue_type_style_index_0_scoped_715d0679_lang = "";
const _sfc_main$o = {
  name: "MCorrelation",
  props,
  emits: ["update:modelValue"],
  setup(props2, { emit }) {
    const dialogVisible = ref$1(false);
    const popupVisible = ref$1(false);
    const { proxy } = getCurrentInstance();
    let showIndex = 0;
    watch([dialogVisible, popupVisible], (val) => {
      if (val[0] !== val[1]) {
        showIndex++;
        list = props2.modelValue || [];
      }
    });
    let list = props2.modelValue || [];
    const onCallback = (e) => {
      list = [...e];
    };
    const selectIds = computed(() => {
      return list.map((m) => m.id);
    });
    const onSave = () => {
      const { limit: limit2, tip } = props2.item.options;
      if (list.length > limit2) {
        if (props2.h5) {
          showToast({
            message: tip || "超出最多关联数量",
            icon: "info-o",
            iconSize: "20px"
          });
        } else {
          proxy.$message.error(tip || "超出最多关联数量");
        }
        return false;
      }
      dialogVisible.value = false;
      popupVisible.value = false;
      emit("update:modelValue", list);
    };
    const vantRules = [
      {
        validator: () => new Promise((resolve) => {
          resolve(!props2.item.options.required || list.length > 0);
        })
      }
    ];
    return {
      ...init(props2, emit),
      showIndex,
      list,
      selectIds,
      dialogVisible,
      popupVisible,
      vantRules,
      onCallback,
      onSave
    };
  }
};
const _hoisted_1$o = {
  key: 0,
  class: "van-correlation__tip"
};
const _hoisted_2$h = ["tabindex"];
const _hoisted_3$c = {
  key: 0,
  class: "footer"
};
const _hoisted_4$8 = ["tabindex"];
const _hoisted_5$6 = {
  key: 0,
  class: "ep-footer"
};
const _hoisted_6$4 = {
  key: 0,
  class: "ep-correlation__tip"
};
const _hoisted_7$4 = { class: "dialog-footer" };
function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
  var _a2;
  const _component_van_button = resolveComponent("van-button");
  const _component_van_field = resolveComponent("van-field");
  const _component_Plus = resolveComponent("Plus");
  const _component_el_button = resolveComponent("el-button");
  const _component_widget_form_item = resolveComponent("widget-form-item");
  const _component_el_dialog = resolveComponent("el-dialog");
  const _component_van_nav_bar = resolveComponent("van-nav-bar");
  const _component_van_popup = resolveComponent("van-popup");
  return openBlock(), createElementBlock(Fragment, null, [
    _ctx.h5 ? (openBlock(), createBlock(_component_van_field, {
      key: 0,
      class: "m-van-cell",
      name: _ctx.item.options && _ctx.item.options.name,
      label: _ctx.item.options && _ctx.item.options.label,
      required: _ctx.item.options && !_ctx.isDetail && _ctx.item.options.required,
      rules: _ctx.isDetail ? [] : $setup.vantRules,
      border: false,
      "label-width": ((_a2 = _ctx.item.options) == null ? void 0 : _a2.labelPosition) === "top" ? "100%" : void 0,
      "label-align": _ctx.item.options && _ctx.item.options.labelPosition || void 0,
      "input-align": _ctx.item.options && _ctx.item.options.inputAlign || void 0,
      error: false
    }, {
      input: withCtx(() => [
        renderSlot(_ctx.$slots, "tip", {}, () => [
          _ctx.item.options.tip ? (openBlock(), createElementBlock("div", _hoisted_1$o, toDisplayString(_ctx.item.options.tip), 1)) : createCommentVNode("", true)
        ], true),
        createVNode(TransitionGroup, {
          tag: "ul",
          class: "correlation-list",
          name: "list"
        }, {
          default: withCtx(() => [
            (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.fieldModel, (obj, i) => {
              return openBlock(), createElementBlock("li", {
                key: i,
                class: "correlation-item",
                tabindex: i
              }, [
                renderSlot(_ctx.$slots, "default", {
                  item: obj,
                  remove: () => _ctx.fieldModel.splice(i, 1)
                }, () => [
                  withDirectives(createElementVNode("span", null, "请在表单组件中使用correlation插槽", 512), [
                    [vShow, !_ctx.designer]
                  ])
                ], true)
              ], 8, _hoisted_2$h);
            }), 128))
          ]),
          _: 3
        }),
        !_ctx.isDetail ? (openBlock(), createElementBlock("div", _hoisted_3$c, [
          renderSlot(_ctx.$slots, "btn", {}, () => [
            createVNode(_component_van_button, {
              plain: "",
              hairline: "",
              type: "primary",
              icon: "add-o",
              size: "small",
              onClick: _cache[0] || (_cache[0] = ($event) => $setup.popupVisible = true)
            }, {
              default: withCtx(() => _cache[6] || (_cache[6] = [
                createTextVNode(" 添加审批 ")
              ])),
              _: 1
            })
          ], true)
        ])) : createCommentVNode("", true)
      ]),
      _: 3
    }, 8, ["name", "label", "required", "rules", "label-width", "label-align", "input-align"])) : (openBlock(), createBlock(_component_widget_form_item, {
      key: 1,
      designer: _ctx.designer,
      "widget-list": _ctx.widgetList,
      item: _ctx.item,
      rules: _ctx.isDetail ? [] : _ctx.rules,
      index: _ctx.index,
      "show-message": !_ctx.isDetail
    }, {
      default: withCtx(() => [
        createVNode(TransitionGroup, {
          tag: "ul",
          class: "correlation-list",
          name: "list"
        }, {
          default: withCtx(() => [
            (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.fieldModel, (obj, i) => {
              return openBlock(), createElementBlock("li", {
                key: i,
                class: "correlation-item",
                tabindex: i
              }, [
                renderSlot(_ctx.$slots, "default", {
                  item: obj,
                  remove: () => _ctx.fieldModel.splice(i, 1)
                }, () => [
                  withDirectives(createElementVNode("span", null, "请在表单组件中使用correlation插槽", 512), [
                    [vShow, !_ctx.designer]
                  ])
                ], true)
              ], 8, _hoisted_4$8);
            }), 128))
          ]),
          _: 3
        }),
        !_ctx.isDetail ? (openBlock(), createElementBlock("div", _hoisted_5$6, [
          renderSlot(_ctx.$slots, "btn", {}, () => [
            createVNode(_component_el_button, {
              plain: "",
              onClick: _cache[1] || (_cache[1] = ($event) => $setup.dialogVisible = true)
            }, {
              icon: withCtx(() => [
                createVNode(_component_Plus)
              ]),
              default: withCtx(() => [
                _cache[7] || (_cache[7] = createTextVNode(" 添加审批 "))
              ]),
              _: 1
            })
          ], true),
          renderSlot(_ctx.$slots, "tip", {}, () => [
            _ctx.item.options.tip ? (openBlock(), createElementBlock("div", _hoisted_6$4, toDisplayString(_ctx.item.options.tip), 1)) : createCommentVNode("", true)
          ], true)
        ])) : createCommentVNode("", true)
      ]),
      _: 3
    }, 8, ["designer", "widget-list", "item", "rules", "index", "show-message"])),
    (openBlock(), createBlock(_component_el_dialog, {
      key: $setup.showIndex,
      modelValue: $setup.dialogVisible,
      "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.dialogVisible = $event),
      title: "选择关联审批",
      class: "correlation-dialog",
      "append-to-body": ""
    }, {
      footer: withCtx(() => [
        createElementVNode("span", _hoisted_7$4, [
          createVNode(_component_el_button, {
            onClick: _cache[2] || (_cache[2] = ($event) => $setup.dialogVisible = false)
          }, {
            default: withCtx(() => _cache[8] || (_cache[8] = [
              createTextVNode("取消")
            ])),
            _: 1
          }),
          createVNode(_component_el_button, {
            type: "primary",
            onClick: $setup.onSave
          }, {
            default: withCtx(() => _cache[9] || (_cache[9] = [
              createTextVNode(" 确定 ")
            ])),
            _: 1
          }, 8, ["onClick"])
        ])
      ]),
      default: withCtx(() => [
        renderSlot(_ctx.$slots, "dialog", {
          options: _ctx.item.options,
          callback: $setup.onCallback
        }, () => [
          withDirectives(createElementVNode("span", null, "请在表单组件中使用correlation-dialog插槽", 512), [
            [vShow, !_ctx.designer]
          ])
        ], true)
      ]),
      _: 3
    }, 8, ["modelValue"])),
    (openBlock(), createBlock(_component_van_popup, {
      key: $setup.showIndex,
      show: $setup.popupVisible,
      "onUpdate:show": _cache[5] || (_cache[5] = ($event) => $setup.popupVisible = $event),
      position: "right",
      style: { width: "100%", height: "100%" },
      "safe-area-inset-top": "",
      "safe-area-inset-bottom": ""
    }, {
      default: withCtx(() => [
        createVNode(_component_van_nav_bar, {
          title: "选择审批",
          "left-arrow": "",
          "z-index": "99",
          placeholder: "",
          onClickLeft: _cache[4] || (_cache[4] = ($event) => $setup.popupVisible = false)
        }),
        renderSlot(_ctx.$slots, "dialog", {
          options: _ctx.item.options,
          callback: $setup.onCallback,
          save: $setup.onSave
        }, () => [
          withDirectives(createElementVNode("span", null, "请在表单组件中使用correlation-dialog插槽", 512), [
            [vShow, !_ctx.designer]
          ])
        ], true)
      ]),
      _: 3
    }, 8, ["show"]))
  ], 64);
}
const mCorrelation = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$n], ["__scopeId", "data-v-715d0679"]]);
function dateTimeFormat(time) {
  const format = "{y}-{m}-{d} {h}:{i}";
  let date = null;
  if (typeof time === "string") {
    time = parseInt(time);
  }
  date = new Date(time);
  const formatObj = {
    y: date.getFullYear(),
    m: date.getMonth() + 1,
    d: date.getDate(),
    h: date.getHours(),
    i: date.getMinutes()
  };
  const strTime = format.replace(/{(y|m|d|h|i)+}/g, (result, key) => {
    let value = formatObj[key];
    if (result.length > 0 && value < 10) {
      value = "0" + value;
    }
    return value;
  });
  return strTime;
}
const formatAllDatechange = ref$1("");
const formatAllDate = ref$1(moment().format("YYYY-MM-DD 08:00:00"));
const currentDate = ref$1([moment().format("MM月DD日今天"), "08时", "00分"]);
const initDate = (value) => {
  if (value) {
    formatAllDate.value = value;
  }
};
let arrdate = reactive([]);
let formatArr = reactive([]);
const hourarr = reactive([]);
const minarr = reactive([]);
const columns = ref$1([]);
function getYear(type2, dates) {
  var dd = /* @__PURE__ */ new Date();
  var n = dates || 0;
  var year = dd.getFullYear() + Number(n);
  if (type2 === "s") {
    return year + "-01-01";
  }
  if (type2 === "e") {
    return year + "-12-31";
  }
  if (!type2) {
    return year + "-01-01/" + year + "-12-31";
  }
  return "";
}
function getchooseDay(begin, end) {
  var beginTime = begin.split("-");
  var endTime = end.split("-");
  var beginDay = /* @__PURE__ */ new Date();
  beginDay.setUTCFullYear(beginTime[0], beginTime[1] - 1, beginTime[2]);
  var endDay = /* @__PURE__ */ new Date();
  endDay.setUTCFullYear(endTime[0], endTime[1] - 1, endTime[2]);
  var unixDb = beginDay.getTime();
  var unixDe = endDay.getTime();
  const arrDate = [];
  for (var k = unixDb; k <= unixDe; k++) {
    arrDate.push(moment(parseInt(k)).format("YYYY-MM-DD"));
    k = k + 24 * 60 * 60 * 1e3;
  }
  return arrDate;
}
const dateFormat = (value) => {
  const d = new Date(value);
  const year = d.getFullYear();
  const current = (/* @__PURE__ */ new Date()).getFullYear();
  const month = d.getMonth() > 8 ? d.getMonth() + 1 : "0" + (d.getMonth() + 1);
  const day = d.getDate() > 9 ? d.getDate() : "0" + d.getDate();
  const date = month + "月" + day + "日" + getdaytext(d.getDay());
  let time = "";
  if (year !== current) {
    time = year + "年" + date;
  } else {
    time = date;
  }
  return time;
};
const getdaytext = (weekNum) => {
  let week = "";
  switch (weekNum) {
    case 0:
      week = "周日";
      break;
    case 1:
      week = "周一";
      break;
    case 2:
      week = "周二";
      break;
    case 3:
      week = "周三";
      break;
    case 4:
      week = "周四";
      break;
    case 5:
      week = "周五";
      break;
    case 6:
      week = "周六";
      break;
  }
  return week;
};
const getcolumnsDate = () => {
  arrdate = getchooseDay(getYear("s", -1), getYear("e", 1));
  formatArr = arrdate.map((it) => {
    return dateFormat(it);
  });
  const time = dateTimeFormat((/* @__PURE__ */ new Date()).getTime());
  const index = currentIndexs(1, time);
  formatArr[index] = formatArr[index].toString().split("周")[0] + "今天";
  for (let i = 0; i < 24; i++) {
    hourarr.push(i > 9 ? i.toString() + "时" : "0" + i + "时");
  }
  for (let i = 0; i < 60; i++) {
    minarr.push(i > 9 ? i.toString() + "分" : "0" + i + "分");
  }
  const columnsDate = [
    {
      values: formatArr,
      className: "dateTime",
      defaultIndex: currentIndexs(1, formatAllDate.value)
    },
    {
      values: hourarr,
      className: "hourarr",
      defaultIndex: currentIndexs(2, formatAllDate.value)
    },
    {
      values: minarr,
      className: "minarr",
      defaultIndex: currentIndexs(3, formatAllDate.value)
    }
  ];
  return columnsDate;
};
const currentIndexs = (column, value) => {
  let index = 0;
  const timeArr = value.replace(" ", ":").split(":");
  if (column === 1) {
    index = arrdate.map((item) => item).indexOf(timeArr[0]);
  } else if (column === 2) {
    index = hourarr.map((item) => item).indexOf(timeArr[1] + "时");
  } else {
    index = minarr.map((item) => item).indexOf(timeArr[2] + "分");
  }
  return index;
};
const onChangeDate = ({ selectedValues }) => {
  let currentyear = "";
  let currentmonth = "";
  let currentday = "";
  const currenthour = selectedValues[1].replace("时", "");
  const cirremtminutes = selectedValues[2].replace("分", "");
  const type2 = isNaN(selectedValues[0].substr(0, 4));
  if (type2) {
    currentyear = (/* @__PURE__ */ new Date()).getFullYear();
    currentmonth = selectedValues[0].substr(0, 2);
    currentday = selectedValues[0].substr(3, 2);
  } else {
    currentyear = selectedValues[0].substr(0, 4);
    currentmonth = selectedValues[0].substr(5, 2);
    currentday = selectedValues[0].substr(8, 2);
  }
  const currentminhou = currentyear + "-" + currentmonth + "-" + currentday + " " + currenthour + ":" + cirremtminutes;
  formatAllDatechange.value = currentminhou;
};
const confirmchooseTime = () => {
  if (formatAllDatechange.value) {
    formatAllDate.value = formatAllDatechange.value;
  }
};
const _sfc_main$n = {
  name: "MDate",
  props,
  emits: ["update:modelValue"],
  setup(props2, { emit }) {
    const showPicker = ref$1(false);
    const day = moment().toObject();
    const currentDate1 = ref$1([day.years, day.months + 1, day.date]);
    const type2 = computed(() => props2.item.options.type || "datetime");
    const format = computed(() => {
      if (props2.item.options.format) {
        return props2.item.options.format;
      }
      if (props2.item.options.type === "datetime") {
        return "YYYY-MM-DD HH:mm:ss";
      }
      return "YYYY-MM-DD";
    });
    const formatter = (type3, val) => {
      if (type3 === "year") {
        return val + "年";
      }
      if (type3 === "month") {
        return val + "月";
      }
      if (type3 === "day") {
        return val + "日";
      }
      return val;
    };
    const onShowPicker = () => {
      const { isDetail } = init(props2, emit);
      if (!props2.item.options.readonly && !props2.item.options.disabled && !isDetail.value) {
        if (type2.value === "datetime") {
          initDate(props2.item.options.defaultValue);
          const values = getcolumnsDate().map(
            (g) => g.values.map((m) => {
              return { text: m, value: m };
            })
          );
          columns.value = values;
        }
        showPicker.value = true;
      }
    };
    const onConfirm = ({ selectedValues }) => {
      selectedValues[1]--;
      emit("update:modelValue", moment(selectedValues).format(format.value));
      showPicker.value = false;
    };
    const onConfirm2 = () => {
      confirmchooseTime();
      emit("update:modelValue", moment(formatAllDate.value).format(format.value));
      showPicker.value = false;
    };
    return {
      showPicker,
      currentDate,
      currentDate1,
      formatAllDate,
      type: type2,
      format,
      formatter,
      columns,
      onShowPicker,
      onConfirm,
      onConfirm2,
      onChangeDate,
      ...init(props2, emit)
    };
  }
};
const _hoisted_1$n = { key: 1 };
function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
  var _a2;
  const _component_van_field = resolveComponent("van-field");
  const _component_el_date_picker = resolveComponent("el-date-picker");
  const _component_widget_form_item = resolveComponent("widget-form-item");
  const _component_van_picker = resolveComponent("van-picker");
  const _component_van_date_picker = resolveComponent("van-date-picker");
  const _component_van_popup = resolveComponent("van-popup");
  return openBlock(), createElementBlock(Fragment, null, [
    _ctx.h5 ? (openBlock(), createBlock(_component_van_field, {
      key: 0,
      modelValue: _ctx.fieldModel,
      "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.fieldModel = $event),
      "is-link": !_ctx.isDetail,
      readonly: "",
      name: _ctx.item.options && _ctx.item.options.name,
      label: _ctx.item.options && _ctx.item.options.label,
      disabled: _ctx.item.options && _ctx.item.options.disabled,
      placeholder: _ctx.isDetail ? "" : _ctx.item.options && _ctx.item.options.placeholder,
      required: _ctx.item.options && !_ctx.isDetail && _ctx.item.options.required,
      rules: _ctx.isDetail ? [] : _ctx.rules,
      border: false,
      "label-width": ((_a2 = _ctx.item.options) == null ? void 0 : _a2.labelPosition) === "top" ? "100%" : void 0,
      "label-align": _ctx.item.options && _ctx.item.options.labelPosition || void 0,
      "input-align": _ctx.item.options && _ctx.item.options.inputAlign || void 0,
      onClick: $setup.onShowPicker
    }, null, 8, ["modelValue", "is-link", "name", "label", "disabled", "placeholder", "required", "rules", "label-width", "label-align", "input-align", "onClick"])) : (openBlock(), createBlock(_component_widget_form_item, {
      key: 1,
      designer: _ctx.designer,
      "widget-list": _ctx.widgetList,
      item: _ctx.item,
      rules: _ctx.isDetail ? [] : _ctx.rules,
      index: _ctx.index,
      "show-message": !_ctx.isDetail
    }, {
      default: withCtx(() => [
        !_ctx.isDetail ? (openBlock(), createBlock(_component_el_date_picker, {
          key: 0,
          modelValue: _ctx.fieldModel,
          "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.fieldModel = $event),
          type: $setup.type,
          style: normalizeStyle([{ "display": "inline-flex" }, { width: "100%" }]),
          disabled: _ctx.item.options && _ctx.item.options.disabled,
          readonly: _ctx.item.options && _ctx.item.options.readonly,
          placeholder: _ctx.item.options && _ctx.item.options.placeholder,
          clearable: _ctx.item.options && _ctx.item.options.clearable,
          format: $setup.format,
          "value-format": $setup.format,
          editable: false
        }, null, 8, ["modelValue", "type", "disabled", "readonly", "placeholder", "clearable", "format", "value-format"])) : (openBlock(), createElementBlock("div", _hoisted_1$n, toDisplayString(_ctx.fieldModel), 1))
      ]),
      _: 1
    }, 8, ["designer", "widget-list", "item", "rules", "index", "show-message"])),
    createVNode(_component_van_popup, {
      show: $setup.showPicker,
      "onUpdate:show": _cache[6] || (_cache[6] = ($event) => $setup.showPicker = $event),
      round: "",
      position: "bottom"
    }, {
      default: withCtx(() => [
        $setup.type === "datetime" ? (openBlock(), createBlock(_component_van_picker, {
          key: 0,
          modelValue: $setup.currentDate,
          "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.currentDate = $event),
          title: _ctx.item.options.label,
          columns: $setup.columns,
          onConfirm: $setup.onConfirm2,
          onCancel: _cache[3] || (_cache[3] = ($event) => $setup.showPicker = false),
          onChange: $setup.onChangeDate
        }, null, 8, ["modelValue", "title", "columns", "onConfirm", "onChange"])) : (openBlock(), createBlock(_component_van_date_picker, {
          key: 1,
          modelValue: $setup.currentDate1,
          "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $setup.currentDate1 = $event),
          title: _ctx.item.options.label,
          onConfirm: $setup.onConfirm,
          onCancel: _cache[5] || (_cache[5] = ($event) => $setup.showPicker = false)
        }, null, 8, ["modelValue", "title", "onConfirm"]))
      ]),
      _: 1
    }, 8, ["show"])
  ], 64);
}
const mDate = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$m]]);
function downloadByBlob(url, name) {
  const image = new Image();
  image.setAttribute("crossOrigin", "anonymous");
  image.src = url;
  image.onload = () => {
    const canvas = document.createElement("canvas");
    canvas.width = image.width;
    canvas.height = image.height;
    const ctx = canvas.getContext("2d");
    ctx.drawImage(image, 0, 0, image.width, image.height);
    canvas.toBlob((blob) => {
      const url2 = URL.createObjectURL(blob);
      download(url2, name);
      URL.revokeObjectURL(url2);
    });
  };
}
function download(href, name) {
  const eleLink = document.createElement("a");
  eleLink.download = name;
  eleLink.href = href;
  eleLink.click();
  eleLink.remove();
}
const isImageType$1 = (file) => {
  const type2 = getFileType(file);
  if (type2.includes("image/")) {
    return true;
  }
  return false;
};
const getIconByFileType = (file) => {
  const type2 = getFileType(file);
  if (type2.includes("image/")) {
    return "jpg";
  }
  if (type2 === "application/msword") {
    return "doc";
  }
  if (type2 === "application/vnd.openxmlformats-officedocument.wordprocessingml.document") {
    return "doc";
  }
  if (type2 === "application/vnd.ms-excel") {
    return "xls";
  }
  if (type2 === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") {
    return "xls";
  }
  if (type2 === "application/vnd.ms-powerpoint") {
    return "ppt";
  }
  if (type2 === "application/vnd.openxmlformats-officedocument.presentationml.presentation") {
    return "ppt";
  }
  if (type2 === "application/x-zip-compressed") {
    return "zip";
  }
  if (type2 === "application/octet-stream") {
    return "zip";
  }
  return "unknown";
};
const getFileType = (file) => {
  let { type: type2 } = file;
  if (!type2) {
    type2 = file.raw.type;
  }
  return type2 || "unknown";
};
const savePicture = (picurl) => {
  showToast({
    type: "loading",
    message: "正在保存...",
    forbidClick: true,
    duration: 0,
    loadingType: "spinner"
  });
  const dtask = plus.downloader.createDownload(picurl, {}, function(d, status) {
    console.log("下载结果", d, status);
    if (status === 200) {
      plus.gallery.save(
        picurl,
        function() {
          showToast("保存成功");
        },
        function(e) {
          console.log("保存失败，请重试！", e);
          showToast("保存失败，请重试！");
        }
      );
    } else {
      showToast("Download failed: " + status);
    }
  });
  dtask.start();
};
const mFileupload_vue_vue_type_style_index_0_scoped_79acfc96_lang = "";
const mFileupload_vue_vue_type_style_index_1_lang = "";
const _sfc_main$m = {
  name: "MFileupload",
  props,
  emits: ["update:modelValue"],
  setup(props2, { emit }) {
    const { proxy } = getCurrentInstance();
    const showViewer = ref$1(false);
    const preview = computed(() => {
      return Array.isArray(fileList.value) && fileList.value.length > 0;
    });
    const previewIndex = ref$1(0);
    const imageIndex = computed(() => {
      if (previewIndex.value > fileList.value.length - 1) {
        return 0;
      }
      return previewIndex.value;
    });
    const previewSrcList = computed(() => {
      return fileList.value.map((s) => s.url);
    });
    const prevOverflow = "";
    function closeViewer() {
      document.body.style.overflow = prevOverflow;
      showViewer.value = false;
    }
    const accept = computed(() => {
      var ua = navigator.userAgent.toLowerCase();
      if (ua.indexOf("iphone") !== -1) {
        return "";
      }
      return "image/*";
    });
    const fileList = ref$1([]);
    const getFileList = computed(() => {
      const list = fileList.value.map((m) => {
        const { id, name, type: type2, size } = m;
        return { id, name, type: type2, size };
      });
      console.log("getFileList :>> ", list);
      return list;
    });
    const setFileList = (files) => {
      const addfiles = _.cloneDeep(files.filter((m) => !fileList.value.find((x) => x.id === m.id)));
      const { actionBlob } = props2.item.options;
      if (actionBlob) {
        addfiles.forEach((file) => {
          if (file.id && file.type.includes("image/")) {
            file.url = proxy.$axios.getUrl(actionBlob + "/" + file.id);
            file.isImage = true;
          }
        });
      }
      fileList.value.push(...addfiles);
      console.log("fileList.value :>> ", fileList.value);
    };
    const downloadFile = (file) => {
      const { actionBlob } = props2.item.options;
      proxy.$axios.download(actionBlob + "/" + file.id);
    };
    watch(
      () => props2.modelValue,
      (files) => {
        if (files) {
          setFileList(files);
        }
      },
      { immediate: true }
    );
    const handleRemove = (file) => {
      const { isDetail } = init(props2, emit);
      if (isDetail.value) {
        return false;
      }
      fileList.value.splice(fileList.value.indexOf(file), 1);
      emit("update:modelValue", getFileList.value);
    };
    const handlePictureCardPreview = (file) => {
      if (!preview.value)
        return;
      const index = fileList.value.findIndex((x) => x === file);
      previewIndex.value = index;
      document.body.style.overflow = "hidden";
      showViewer.value = true;
    };
    const fileMaxSize = computed(() => {
      return Number(props2.item.options.fileMaxSize || 5) * 1024 * 1024;
    });
    const handleBeforeUpload = (file) => new Promise((resolve, reject) => {
      const accept2 = props2.item.options.accept || "*";
      if (accept2 !== "*") {
        const extArrs = accept2.replace("，", ",").split(",");
        const extFileName = file.name.substring(file.name.lastIndexOf("."));
        if (!extArrs.includes(extFileName)) {
          if (props2.h5) {
            showToast(`不支持格式：${extFileName}`);
          } else {
            proxy.$message.error(`不支持格式：${extFileName}`);
          }
          reject();
        }
      }
      const fileMaxSize2 = props2.item.options.fileMaxSize || 5;
      if (file.size >= Number(fileMaxSize2) * 1024 * 1024) {
        if (props2.h5) {
          showToast(`文件大小已超出：${fileMaxSize2}MB`);
        } else {
          proxy.$message.error(`文件大小已超出：${fileMaxSize2}MB`);
        }
        reject();
      }
      resolve();
    });
    const handleOnSuccess = (response, uploadFile, uploadFiles) => {
      const { id } = response;
      if (id)
        uploadFile.id = id;
      uploadFile.type = uploadFile.raw.type;
      console.log("uploadFile :>> ", uploadFile);
      const list = uploadFiles.map((m) => {
        const { id: id2, name, type: type2, size } = m;
        return { id: id2, name, type: type2, size };
      });
      emit("update:modelValue", list);
    };
    const handleOnError = () => {
      proxy.$message.error("上传失败！");
    };
    const handleOnExceed = () => {
      proxy.$message.error(`最大上传数量(${props2.item.options.limit})已超出.`);
    };
    const handleHttpRequest = (options2) => {
      console.log("options :>> ", options2, fileList);
      const file = fileList.value.find((m) => m.uid === options2.file.uid);
      file.status = "uploading";
      file.size = options2.file.size;
      const config = {
        // axios 1.3.4 更新
        headers: {
          "Content-Type": "multipart/form-data"
        },
        "Content-Type": "multipart/form-data",
        timeout: 999999,
        onUploadProgress: (progressEvent) => {
          file.percentage = Number((progressEvent.loaded / progressEvent.total * 100).toFixed(2));
        }
      };
      const formdata = new FormData();
      formdata.append("file", options2.file);
      proxy.$axios.post(options2.action, formdata, config).then((res) => {
        file.progress = "success";
        options2.onSuccess(res);
      }).catch((error) => {
        console.log("error :>> ", error);
        file.progress = "warning";
        options2.onError(error);
      });
    };
    const afterRead = (content) => {
      console.log("content :>> ", content);
      content.name = content.file.name;
      content.type = content.file.type;
      content.size = content.file.size;
      content.status = "uploading";
      content.message = "上传中...";
      const config = {
        // axios 1.3.4 更新
        headers: {
          "Content-Type": "multipart/form-data"
        },
        "Content-Type": "multipart/form-data",
        timeout: 999999
      };
      const formdata = new FormData();
      formdata.append("file", content.file);
      proxy.$axios.post(props2.item.options.action, formdata, config).then((res) => {
        content.id = res.id;
        content.status = "done";
        content.message = "";
        emit("update:modelValue", getFileList.value);
      }).catch((error) => {
        console.log("error :>> ", error);
        handleRemove(content);
        showToast("上传失败！");
      });
    };
    const hiddenUploadBtn = computed(() => {
      return fileList.value.length >= props2.item.options.limit;
    });
    const onClickPreview = (file) => {
      if (!file.isImage) {
        const { actionBlob } = props2.item.options;
        const remoteUrl = proxy.$axios.getUrl(actionBlob + "/" + file.id);
        const extFileName = file.name.substring(file.name.lastIndexOf(".") + 1);
        const params = {
          fileName: file.uid || file.id,
          // 文件名
          fileType: extFileName,
          // 文件类型  doc, docx, xls, xlsx, ppt, pptx, pdf
          url: location.origin + remoteUrl
          // 下载资源的 url，完整的url地址 https://xxxxxx.xx
        };
        if (window.ECampus) {
          window.ECampus.downloadFile(params);
        } else {
          proxy.$axios.download(actionBlob + "/" + file.id);
        }
      }
    };
    return {
      preview,
      imageIndex,
      showViewer,
      previewSrcList,
      fileList,
      accept,
      hiddenUploadBtn,
      fileMaxSize,
      afterRead,
      getFileType,
      isImageType: isImageType$1,
      getIconByFileType,
      downloadFile,
      savePicture,
      closeViewer,
      handleRemove,
      handlePictureCardPreview,
      handleBeforeUpload,
      handleOnSuccess,
      handleOnError,
      handleOnExceed,
      handleHttpRequest,
      onClickPreview,
      ...init(props2, emit)
    };
  }
};
const _hoisted_1$m = { key: 0 };
const _hoisted_2$g = {
  key: 0,
  class: "van-uploader__upload"
};
const _hoisted_3$b = { class: "van-uploader__tip" };
const _hoisted_4$7 = {
  key: 1,
  class: "file-btn"
};
const _hoisted_5$5 = { class: "van-uploader__tip" };
const _hoisted_6$3 = {
  key: 0,
  class: "preview-cover-file-icon"
};
const _hoisted_7$3 = {
  key: 0,
  style: { "display": "flex", "width": "100%" }
};
const _hoisted_8$3 = ["src"];
const _hoisted_9$3 = {
  key: 1,
  class: "ep-preview-cover-file-icon"
};
const _hoisted_10$3 = { class: "el-upload-list__item-info" };
const _hoisted_11$3 = { class: "el-upload-list__item-name" };
const _hoisted_12$3 = { class: "el-upload-list__item-file-name" };
const _hoisted_13$2 = { class: "el-upload-list__item-name" };
const _hoisted_14$1 = { style: { "color": "#a8abb2" } };
const _hoisted_15$1 = {
  key: 2,
  class: "el-upload-list__item-status-label"
};
const _hoisted_16$1 = {
  key: 4,
  class: "el-icon--close-tip"
};
const _hoisted_17$1 = {
  key: 1,
  class: "el-upload-list__item-actions"
};
const _hoisted_18$1 = ["onClick"];
const _hoisted_19$1 = {
  key: 0,
  class: "el-upload-list__item-action"
};
const _hoisted_20$1 = {
  key: 2,
  class: "flex-center"
};
const _hoisted_21$1 = ["src"];
const _hoisted_22$1 = {
  key: 1,
  class: "ep-preview-cover-file-icon"
};
const _hoisted_23 = { class: "el-upload-list__item-actions" };
const _hoisted_24 = ["onClick"];
const _hoisted_25 = ["onClick"];
const _hoisted_26 = ["onClick"];
const _hoisted_27 = {
  key: 0,
  class: "el-upload__tip"
};
function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
  var _a2;
  const _component_van_icon = resolveComponent("van-icon");
  const _component_van_button = resolveComponent("van-button");
  const _component_m_icon = resolveComponent("m-icon");
  const _component_van_uploader = resolveComponent("van-uploader");
  const _component_van_field = resolveComponent("van-field");
  const _component_Plus = resolveComponent("Plus");
  const _component_el_icon = resolveComponent("el-icon");
  const _component_el_button = resolveComponent("el-button");
  const _component_el_progress = resolveComponent("el-progress");
  const _component_Check = resolveComponent("Check");
  const _component_Close = resolveComponent("Close");
  const _component_ZoomIn = resolveComponent("ZoomIn");
  const _component_Download = resolveComponent("Download");
  const _component_Delete = resolveComponent("Delete");
  const _component_el_upload = resolveComponent("el-upload");
  const _component_widget_form_item = resolveComponent("widget-form-item");
  const _component_image_viewer = resolveComponent("image-viewer");
  return openBlock(), createElementBlock(Fragment, null, [
    _ctx.h5 ? (openBlock(), createElementBlock("div", _hoisted_1$m, [
      $setup.fileList.length > 0 || !_ctx.isDetail ? (openBlock(), createBlock(_component_van_field, {
        key: 0,
        class: "m-van-cell",
        name: _ctx.item.options && _ctx.item.options.name,
        label: _ctx.item.options && _ctx.item.options.label,
        required: _ctx.item.options && !_ctx.isDetail && _ctx.item.options.required,
        rules: _ctx.isDetail ? [] : _ctx.rules,
        border: false,
        "label-width": ((_a2 = _ctx.item.options) == null ? void 0 : _a2.labelPosition) === "top" ? "100%" : void 0,
        "label-align": _ctx.item.options && _ctx.item.options.labelPosition || void 0,
        "input-align": _ctx.item.options && _ctx.item.options.inputAlign || void 0,
        readonly: "",
        autocomplete: "off"
      }, {
        input: withCtx(() => [
          createVNode(_component_van_uploader, {
            modelValue: $setup.fileList,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.fileList = $event),
            "max-count": _ctx.isDetail ? 0 : _ctx.item.options && _ctx.item.options.limit,
            "max-size": $setup.fileMaxSize,
            accept: $setup.accept,
            "before-read": $setup.handleBeforeUpload,
            "after-read": $setup.afterRead,
            "before-delete": $setup.handleRemove,
            deletable: !_ctx.isDetail,
            disabled: _ctx.item.options && _ctx.item.options.disabled,
            "preview-options": { closeable: true, showIndex: false },
            class: normalizeClass([_ctx.item.options.listType]),
            "result-type": "dataUrl",
            onClickPreview: $setup.onClickPreview
          }, {
            "preview-cover": withCtx(({ type: type2 }) => [
              !$setup.isImageType({ type: type2 }) ? (openBlock(), createElementBlock("div", _hoisted_6$3, [
                createVNode(_component_m_icon, {
                  name: $setup.getIconByFileType({ type: type2 })
                }, null, 8, ["name"])
              ])) : createCommentVNode("", true)
            ]),
            default: withCtx(() => [
              _ctx.item.options.listType === "picture-card" ? (openBlock(), createElementBlock("div", _hoisted_2$g, [
                createVNode(_component_van_icon, {
                  name: "photograph",
                  class: "van-uploader__upload-icon"
                }),
                createElementVNode("div", _hoisted_3$b, toDisplayString(_ctx.item.options.tip), 1)
              ])) : (openBlock(), createElementBlock("div", _hoisted_4$7, [
                createVNode(_component_van_button, {
                  icon: "plus",
                  type: "primary",
                  size: "small"
                }, {
                  default: withCtx(() => _cache[2] || (_cache[2] = [
                    createTextVNode("上传文件")
                  ])),
                  _: 1
                }),
                createElementVNode("div", _hoisted_5$5, toDisplayString(_ctx.item.options.tip), 1)
              ]))
            ]),
            _: 1
          }, 8, ["modelValue", "max-count", "max-size", "accept", "before-read", "after-read", "before-delete", "deletable", "disabled", "class", "onClickPreview"])
        ]),
        _: 1
      }, 8, ["name", "label", "required", "rules", "label-width", "label-align", "input-align"])) : createCommentVNode("", true)
    ])) : (openBlock(), createBlock(_component_widget_form_item, {
      key: 1,
      class: "ep-fileupload",
      designer: _ctx.designer,
      "widget-list": _ctx.widgetList,
      item: _ctx.item,
      rules: _ctx.isDetail ? [] : _ctx.rules,
      index: _ctx.index,
      "show-message": !_ctx.isDetail
    }, {
      default: withCtx(() => [
        createVNode(_component_el_upload, {
          "file-list": $setup.fileList,
          "onUpdate:fileList": _cache[1] || (_cache[1] = ($event) => $setup.fileList = $event),
          style: { width: "100%" },
          class: normalizeClass([{ hiddenUploadBtn: $setup.hiddenUploadBtn }]),
          accept: $setup.accept,
          action: _ctx.item.options && _ctx.item.options.action,
          disabled: _ctx.item.options && _ctx.item.options.disabled,
          limit: _ctx.item.options && _ctx.item.options.limit,
          "list-type": _ctx.item.options && _ctx.item.options.listType,
          "before-upload": $setup.handleBeforeUpload,
          "on-success": $setup.handleOnSuccess,
          "on-error": $setup.handleOnError,
          "on-exceed": $setup.handleOnExceed,
          "http-request": $setup.handleHttpRequest
        }, createSlots({
          tip: withCtx(() => [
            _ctx.item.options.tip && !_ctx.isDetail ? (openBlock(), createElementBlock("div", _hoisted_27, toDisplayString(_ctx.item.options.tip), 1)) : createCommentVNode("", true)
          ]),
          default: withCtx(() => [
            _ctx.item.options.listType === "picture-card" && !_ctx.isDetail && !$setup.hiddenUploadBtn ? (openBlock(), createBlock(_component_el_icon, { key: 0 }, {
              default: withCtx(() => [
                createVNode(_component_Plus)
              ]),
              _: 1
            })) : createCommentVNode("", true),
            _ctx.item.options.listType !== "picture-card" && !_ctx.isDetail && !$setup.hiddenUploadBtn ? (openBlock(), createBlock(_component_el_button, {
              key: 1,
              type: "default"
            }, {
              default: withCtx(() => [
                createTextVNode(toDisplayString(_ctx.item.options.btn || "添加"), 1)
              ]),
              _: 1
            })) : createCommentVNode("", true)
          ]),
          _: 2
        }, [
          _ctx.item.options.listType !== "text" ? {
            name: "file",
            fn: withCtx(({ file }) => [
              _ctx.item.options.listType === "picture" ? (openBlock(), createElementBlock("div", _hoisted_7$3, [
                $setup.isImageType(file) ? (openBlock(), createElementBlock("img", {
                  key: 0,
                  class: "el-upload-list__item-thumbnail",
                  src: file.url,
                  alt: ""
                }, null, 8, _hoisted_8$3)) : (openBlock(), createElementBlock("div", _hoisted_9$3, [
                  createVNode(_component_m_icon, {
                    name: $setup.getIconByFileType(file)
                  }, null, 8, ["name"])
                ])),
                createElementVNode("div", _hoisted_10$3, [
                  createElementVNode("a", _hoisted_11$3, [
                    createElementVNode("span", _hoisted_12$3, toDisplayString(file.name), 1)
                  ]),
                  createElementVNode("a", _hoisted_13$2, [
                    createElementVNode("span", _hoisted_14$1, toDisplayString(Number(file.size / 1024 / 1024).toFixed(2) + " MB"), 1)
                  ]),
                  file.status === "uploading" ? (openBlock(), createBlock(_component_el_progress, {
                    key: 0,
                    type: "line",
                    "stroke-width": 2,
                    percentage: Number(file.percentage || 0),
                    style: { "margin-top": "0.5rem" }
                  }, null, 8, ["percentage"])) : createCommentVNode("", true)
                ]),
                !_ctx.isDetail ? (openBlock(), createElementBlock("label", _hoisted_15$1, [
                  createVNode(_component_el_icon, { class: "el-icon--upload-success el-icon--check" }, {
                    default: withCtx(() => [
                      createVNode(_component_Check)
                    ]),
                    _: 1
                  })
                ])) : createCommentVNode("", true),
                !_ctx.isDetail ? (openBlock(), createBlock(_component_el_icon, {
                  key: 3,
                  class: "el-icon--upload-success el-icon--close"
                }, {
                  default: withCtx(() => [
                    createVNode(_component_Close, {
                      onClick: ($event) => $setup.handleRemove(file)
                    }, null, 8, ["onClick"])
                  ]),
                  _: 2
                }, 1024)) : createCommentVNode("", true),
                !_ctx.isDetail ? (openBlock(), createElementBlock("i", _hoisted_16$1, "按 delete 键可删除")) : createCommentVNode("", true)
              ])) : createCommentVNode("", true),
              _ctx.item.options.listType === "picture" ? (openBlock(), createElementBlock("div", _hoisted_17$1, [
                createElementVNode("span", {
                  class: "el-upload-list__item-preview",
                  onClick: ($event) => $setup.handlePictureCardPreview(file)
                }, [
                  withDirectives(createVNode(_component_el_icon, null, {
                    default: withCtx(() => [
                      createVNode(_component_ZoomIn)
                    ]),
                    _: 2
                  }, 1536), [
                    [vShow, $setup.getFileType(file).includes("image/")]
                  ])
                ], 8, _hoisted_18$1),
                _ctx.isDetail ? (openBlock(), createElementBlock("span", _hoisted_19$1, [
                  createVNode(_component_el_icon, {
                    class: "action-icon",
                    onClick: ($event) => $setup.downloadFile(file)
                  }, {
                    default: withCtx(() => [
                      createVNode(_component_Download)
                    ]),
                    _: 2
                  }, 1032, ["onClick"])
                ])) : createCommentVNode("", true)
              ])) : createCommentVNode("", true),
              _ctx.item.options.listType === "picture-card" ? (openBlock(), createElementBlock("div", _hoisted_20$1, [
                $setup.isImageType(file) ? (openBlock(), createElementBlock("img", {
                  key: 0,
                  class: "el-upload-list__item-thumbnail",
                  src: file.url,
                  alt: ""
                }, null, 8, _hoisted_21$1)) : (openBlock(), createElementBlock("div", _hoisted_22$1, [
                  createVNode(_component_m_icon, {
                    name: $setup.getIconByFileType(file)
                  }, null, 8, ["name"])
                ])),
                file.status === "uploading" ? (openBlock(), createBlock(_component_el_progress, {
                  key: 2,
                  type: "circle",
                  width: 90,
                  "stroke-width": 5,
                  percentage: Number(file.percentage || 0),
                  style: { "display": "flex", "justify-content": "center", "align-items": "center" }
                }, null, 8, ["percentage"])) : createCommentVNode("", true),
                createElementVNode("span", _hoisted_23, [
                  $setup.getFileType(file).includes("image/") ? (openBlock(), createElementBlock("span", {
                    key: 0,
                    class: "el-upload-list__item-preview",
                    onClick: ($event) => $setup.handlePictureCardPreview(file)
                  }, [
                    createVNode(_component_el_icon, null, {
                      default: withCtx(() => [
                        createVNode(_component_ZoomIn)
                      ]),
                      _: 1
                    })
                  ], 8, _hoisted_24)) : createCommentVNode("", true),
                  _ctx.isDetail ? (openBlock(), createElementBlock("span", {
                    key: 1,
                    class: "el-upload-list__item-download",
                    onClick: ($event) => $setup.downloadFile(file)
                  }, [
                    createVNode(_component_el_icon, null, {
                      default: withCtx(() => [
                        createVNode(_component_Download)
                      ]),
                      _: 1
                    })
                  ], 8, _hoisted_25)) : createCommentVNode("", true),
                  !_ctx.isDetail ? (openBlock(), createElementBlock("span", {
                    key: 2,
                    class: "el-upload-list__item-delete",
                    onClick: ($event) => $setup.handleRemove(file)
                  }, [
                    createVNode(_component_el_icon, null, {
                      default: withCtx(() => [
                        createVNode(_component_Delete)
                      ]),
                      _: 1
                    })
                  ], 8, _hoisted_26)) : createCommentVNode("", true)
                ])
              ])) : createCommentVNode("", true)
            ]),
            key: "0"
          } : void 0
        ]), 1032, ["file-list", "class", "accept", "action", "disabled", "limit", "list-type", "before-upload", "on-success", "on-error", "on-exceed", "http-request"])
      ]),
      _: 1
    }, 8, ["designer", "widget-list", "item", "rules", "index", "show-message"])),
    $setup.preview ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
      $setup.showViewer ? (openBlock(), createBlock(_component_image_viewer, {
        key: 0,
        teleported: true,
        "initial-index": $setup.imageIndex,
        "url-list": $setup.previewSrcList,
        onClose: $setup.closeViewer
      }, null, 8, ["initial-index", "url-list", "onClose"])) : createCommentVNode("", true)
    ], 64)) : createCommentVNode("", true)
  ], 64);
}
const mFileupload = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$l], ["__scopeId", "data-v-79acfc96"]]);
/*!
 * Compressor.js v1.2.1
 * https://fengyuanchen.github.io/compressorjs
 *
 * Copyright 2018-present Chen Fengyuan
 * Released under the MIT license
 *
 * Date: 2023-02-28T14:09:41.732Z
 */
function ownKeys(object, enumerableOnly) {
  var keys = Object.keys(object);
  if (Object.getOwnPropertySymbols) {
    var symbols = Object.getOwnPropertySymbols(object);
    enumerableOnly && (symbols = symbols.filter(function(sym) {
      return Object.getOwnPropertyDescriptor(object, sym).enumerable;
    })), keys.push.apply(keys, symbols);
  }
  return keys;
}
function _objectSpread2(target) {
  for (var i = 1; i < arguments.length; i++) {
    var source = null != arguments[i] ? arguments[i] : {};
    i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
      _defineProperty(target, key, source[key]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
      Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
    });
  }
  return target;
}
function _classCallCheck(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties(target, props2) {
  for (var i = 0; i < props2.length; i++) {
    var descriptor = props2[i];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
  }
}
function _createClass(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties(Constructor, staticProps);
  Object.defineProperty(Constructor, "prototype", {
    writable: false
  });
  return Constructor;
}
function _defineProperty(obj, key, value) {
  key = _toPropertyKey(key);
  if (key in obj) {
    Object.defineProperty(obj, key, {
      value,
      enumerable: true,
      configurable: true,
      writable: true
    });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _extends() {
  _extends = Object.assign ? Object.assign.bind() : function(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = arguments[i];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends.apply(this, arguments);
}
function _toPrimitive(input, hint) {
  if (typeof input !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (typeof res !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
function _toPropertyKey(arg) {
  var key = _toPrimitive(arg, "string");
  return typeof key === "symbol" ? key : String(key);
}
var canvasToBlob = { exports: {} };
(function(module) {
  if (typeof window === "undefined") {
    return;
  }
  (function(window2) {
    var CanvasPrototype = window2.HTMLCanvasElement && window2.HTMLCanvasElement.prototype;
    var hasBlobConstructor = window2.Blob && function() {
      try {
        return Boolean(new Blob());
      } catch (e) {
        return false;
      }
    }();
    var hasArrayBufferViewSupport = hasBlobConstructor && window2.Uint8Array && function() {
      try {
        return new Blob([new Uint8Array(100)]).size === 100;
      } catch (e) {
        return false;
      }
    }();
    var BlobBuilder = window2.BlobBuilder || window2.WebKitBlobBuilder || window2.MozBlobBuilder || window2.MSBlobBuilder;
    var dataURIPattern = /^data:((.*?)(;charset=.*?)?)(;base64)?,/;
    var dataURLtoBlob = (hasBlobConstructor || BlobBuilder) && window2.atob && window2.ArrayBuffer && window2.Uint8Array && function(dataURI) {
      var matches, mediaType, isBase64, dataString, byteString, arrayBuffer, intArray, i, bb;
      matches = dataURI.match(dataURIPattern);
      if (!matches) {
        throw new Error("invalid data URI");
      }
      mediaType = matches[2] ? matches[1] : "text/plain" + (matches[3] || ";charset=US-ASCII");
      isBase64 = !!matches[4];
      dataString = dataURI.slice(matches[0].length);
      if (isBase64) {
        byteString = atob(dataString);
      } else {
        byteString = decodeURIComponent(dataString);
      }
      arrayBuffer = new ArrayBuffer(byteString.length);
      intArray = new Uint8Array(arrayBuffer);
      for (i = 0; i < byteString.length; i += 1) {
        intArray[i] = byteString.charCodeAt(i);
      }
      if (hasBlobConstructor) {
        return new Blob([hasArrayBufferViewSupport ? intArray : arrayBuffer], {
          type: mediaType
        });
      }
      bb = new BlobBuilder();
      bb.append(arrayBuffer);
      return bb.getBlob(mediaType);
    };
    if (window2.HTMLCanvasElement && !CanvasPrototype.toBlob) {
      if (CanvasPrototype.mozGetAsFile) {
        CanvasPrototype.toBlob = function(callback, type2, quality) {
          var self2 = this;
          setTimeout(function() {
            if (quality && CanvasPrototype.toDataURL && dataURLtoBlob) {
              callback(dataURLtoBlob(self2.toDataURL(type2, quality)));
            } else {
              callback(self2.mozGetAsFile("blob", type2));
            }
          });
        };
      } else if (CanvasPrototype.toDataURL && dataURLtoBlob) {
        if (CanvasPrototype.msToBlob) {
          CanvasPrototype.toBlob = function(callback, type2, quality) {
            var self2 = this;
            setTimeout(function() {
              if ((type2 && type2 !== "image/png" || quality) && CanvasPrototype.toDataURL && dataURLtoBlob) {
                callback(dataURLtoBlob(self2.toDataURL(type2, quality)));
              } else {
                callback(self2.msToBlob(type2));
              }
            });
          };
        } else {
          CanvasPrototype.toBlob = function(callback, type2, quality) {
            var self2 = this;
            setTimeout(function() {
              callback(dataURLtoBlob(self2.toDataURL(type2, quality)));
            });
          };
        }
      }
    }
    if (module.exports) {
      module.exports = dataURLtoBlob;
    } else {
      window2.dataURLtoBlob = dataURLtoBlob;
    }
  })(window);
})(canvasToBlob);
var toBlob = canvasToBlob.exports;
var isBlob = function isBlob2(value) {
  if (typeof Blob === "undefined") {
    return false;
  }
  return value instanceof Blob || Object.prototype.toString.call(value) === "[object Blob]";
};
var DEFAULTS = {
  /**
   * Indicates if output the original image instead of the compressed one
   * when the size of the compressed image is greater than the original one's
   * @type {boolean}
   */
  strict: true,
  /**
   * Indicates if read the image's Exif Orientation information,
   * and then rotate or flip the image automatically.
   * @type {boolean}
   */
  checkOrientation: true,
  /**
   * Indicates if retain the image's Exif information after compressed.
   * @type {boolean}
  */
  retainExif: false,
  /**
   * The max width of the output image.
   * @type {number}
   */
  maxWidth: Infinity,
  /**
   * The max height of the output image.
   * @type {number}
   */
  maxHeight: Infinity,
  /**
   * The min width of the output image.
   * @type {number}
   */
  minWidth: 0,
  /**
   * The min height of the output image.
   * @type {number}
   */
  minHeight: 0,
  /**
   * The width of the output image.
   * If not specified, the natural width of the source image will be used.
   * @type {number}
   */
  width: void 0,
  /**
   * The height of the output image.
   * If not specified, the natural height of the source image will be used.
   * @type {number}
   */
  height: void 0,
  /**
   * Sets how the size of the image should be resized to the container
   * specified by the `width` and `height` options.
   * @type {string}
   */
  resize: "none",
  /**
   * The quality of the output image.
   * It must be a number between `0` and `1`,
   * and only available for `image/jpeg` and `image/webp` images.
   * Check out {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob canvas.toBlob}.
   * @type {number}
   */
  quality: 0.8,
  /**
   * The mime type of the output image.
   * By default, the original mime type of the source image file will be used.
   * @type {string}
   */
  mimeType: "auto",
  /**
   * Files whose file type is included in this list,
   * and whose file size exceeds the `convertSize` value will be converted to JPEGs.
   * @type {string｜Array}
   */
  convertTypes: ["image/png"],
  /**
   * PNG files over this size (5 MB by default) will be converted to JPEGs.
   * To disable this, just set the value to `Infinity`.
   * @type {number}
   */
  convertSize: 5e6,
  /**
   * The hook function to execute before draw the image into the canvas for compression.
   * @type {Function}
   * @param {CanvasRenderingContext2D} context - The 2d rendering context of the canvas.
   * @param {HTMLCanvasElement} canvas - The canvas for compression.
   * @example
   * function (context, canvas) {
   *   context.fillStyle = '#fff';
   * }
   */
  beforeDraw: null,
  /**
   * The hook function to execute after drew the image into the canvas for compression.
   * @type {Function}
   * @param {CanvasRenderingContext2D} context - The 2d rendering context of the canvas.
   * @param {HTMLCanvasElement} canvas - The canvas for compression.
   * @example
   * function (context, canvas) {
   *   context.filter = 'grayscale(100%)';
   * }
   */
  drew: null,
  /**
   * The hook function to execute when success to compress the image.
   * @type {Function}
   * @param {File} file - The compressed image File object.
   * @example
   * function (file) {
   *   console.log(file);
   * }
   */
  success: null,
  /**
   * The hook function to execute when fail to compress the image.
   * @type {Function}
   * @param {Error} err - An Error object.
   * @example
   * function (err) {
   *   console.log(err.message);
   * }
   */
  error: null
};
var IS_BROWSER = typeof window !== "undefined" && typeof window.document !== "undefined";
var WINDOW = IS_BROWSER ? window : {};
var isPositiveNumber = function isPositiveNumber2(value) {
  return value > 0 && value < Infinity;
};
var slice = Array.prototype.slice;
function toArray(value) {
  return Array.from ? Array.from(value) : slice.call(value);
}
var REGEXP_IMAGE_TYPE = /^image\/.+$/;
function isImageType(value) {
  return REGEXP_IMAGE_TYPE.test(value);
}
function imageTypeToExtension(value) {
  var extension = isImageType(value) ? value.substr(6) : "";
  if (extension === "jpeg") {
    extension = "jpg";
  }
  return ".".concat(extension);
}
var fromCharCode = String.fromCharCode;
function getStringFromCharCode(dataView, start, length) {
  var str = "";
  var i;
  length += start;
  for (i = start; i < length; i += 1) {
    str += fromCharCode(dataView.getUint8(i));
  }
  return str;
}
var btoa = WINDOW.btoa;
function arrayBufferToDataURL(arrayBuffer, mimeType) {
  var chunks = [];
  var chunkSize = 8192;
  var uint8 = new Uint8Array(arrayBuffer);
  while (uint8.length > 0) {
    chunks.push(fromCharCode.apply(null, toArray(uint8.subarray(0, chunkSize))));
    uint8 = uint8.subarray(chunkSize);
  }
  return "data:".concat(mimeType, ";base64,").concat(btoa(chunks.join("")));
}
function resetAndGetOrientation(arrayBuffer) {
  var dataView = new DataView(arrayBuffer);
  var orientation;
  try {
    var littleEndian;
    var app1Start;
    var ifdStart;
    if (dataView.getUint8(0) === 255 && dataView.getUint8(1) === 216) {
      var length = dataView.byteLength;
      var offset = 2;
      while (offset + 1 < length) {
        if (dataView.getUint8(offset) === 255 && dataView.getUint8(offset + 1) === 225) {
          app1Start = offset;
          break;
        }
        offset += 1;
      }
    }
    if (app1Start) {
      var exifIDCode = app1Start + 4;
      var tiffOffset = app1Start + 10;
      if (getStringFromCharCode(dataView, exifIDCode, 4) === "Exif") {
        var endianness = dataView.getUint16(tiffOffset);
        littleEndian = endianness === 18761;
        if (littleEndian || endianness === 19789) {
          if (dataView.getUint16(tiffOffset + 2, littleEndian) === 42) {
            var firstIFDOffset = dataView.getUint32(tiffOffset + 4, littleEndian);
            if (firstIFDOffset >= 8) {
              ifdStart = tiffOffset + firstIFDOffset;
            }
          }
        }
      }
    }
    if (ifdStart) {
      var _length = dataView.getUint16(ifdStart, littleEndian);
      var _offset;
      var i;
      for (i = 0; i < _length; i += 1) {
        _offset = ifdStart + i * 12 + 2;
        if (dataView.getUint16(_offset, littleEndian) === 274) {
          _offset += 8;
          orientation = dataView.getUint16(_offset, littleEndian);
          dataView.setUint16(_offset, 1, littleEndian);
          break;
        }
      }
    }
  } catch (e) {
    orientation = 1;
  }
  return orientation;
}
function parseOrientation(orientation) {
  var rotate = 0;
  var scaleX = 1;
  var scaleY = 1;
  switch (orientation) {
    case 2:
      scaleX = -1;
      break;
    case 3:
      rotate = -180;
      break;
    case 4:
      scaleY = -1;
      break;
    case 5:
      rotate = 90;
      scaleY = -1;
      break;
    case 6:
      rotate = 90;
      break;
    case 7:
      rotate = 90;
      scaleX = -1;
      break;
    case 8:
      rotate = -90;
      break;
  }
  return {
    rotate,
    scaleX,
    scaleY
  };
}
var REGEXP_DECIMALS = /\.\d*(?:0|9){12}\d*$/;
function normalizeDecimalNumber(value) {
  var times = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1e11;
  return REGEXP_DECIMALS.test(value) ? Math.round(value * times) / times : value;
}
function getAdjustedSizes(_ref) {
  var aspectRatio = _ref.aspectRatio, height = _ref.height, width = _ref.width;
  var type2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "none";
  var isValidWidth = isPositiveNumber(width);
  var isValidHeight = isPositiveNumber(height);
  if (isValidWidth && isValidHeight) {
    var adjustedWidth = height * aspectRatio;
    if ((type2 === "contain" || type2 === "none") && adjustedWidth > width || type2 === "cover" && adjustedWidth < width) {
      height = width / aspectRatio;
    } else {
      width = height * aspectRatio;
    }
  } else if (isValidWidth) {
    height = width / aspectRatio;
  } else if (isValidHeight) {
    width = height * aspectRatio;
  }
  return {
    width,
    height
  };
}
function getExif(arrayBuffer) {
  var array = toArray(new Uint8Array(arrayBuffer));
  var length = array.length;
  var segments = [];
  var start = 0;
  while (start + 3 < length) {
    var value = array[start];
    var next = array[start + 1];
    if (value === 255 && next === 218) {
      break;
    }
    if (value === 255 && next === 216) {
      start += 2;
    } else {
      var offset = array[start + 2] * 256 + array[start + 3];
      var end = start + offset + 2;
      var segment = array.slice(start, end);
      segments.push(segment);
      start = end;
    }
  }
  return segments.reduce(function(exifArray, current) {
    if (current[0] === 255 && current[1] === 225) {
      return exifArray.concat(current);
    }
    return exifArray;
  }, []);
}
function insertExif(arrayBuffer, exifArray) {
  var array = toArray(new Uint8Array(arrayBuffer));
  if (array[2] !== 255 || array[3] !== 224) {
    return arrayBuffer;
  }
  var app0Length = array[4] * 256 + array[5];
  var newArrayBuffer = [255, 216].concat(exifArray, array.slice(4 + app0Length));
  return new Uint8Array(newArrayBuffer);
}
var ArrayBuffer$1 = WINDOW.ArrayBuffer, FileReader = WINDOW.FileReader;
var URL$1 = WINDOW.URL || WINDOW.webkitURL;
var REGEXP_EXTENSION = /\.\w+$/;
var AnotherCompressor = WINDOW.Compressor;
var Compressor = /* @__PURE__ */ function() {
  function Compressor2(file, options2) {
    _classCallCheck(this, Compressor2);
    this.file = file;
    this.exif = [];
    this.image = new Image();
    this.options = _objectSpread2(_objectSpread2({}, DEFAULTS), options2);
    this.aborted = false;
    this.result = null;
    this.init();
  }
  _createClass(Compressor2, [{
    key: "init",
    value: function init2() {
      var _this = this;
      var file = this.file, options2 = this.options;
      if (!isBlob(file)) {
        this.fail(new Error("The first argument must be a File or Blob object."));
        return;
      }
      var mimeType = file.type;
      if (!isImageType(mimeType)) {
        this.fail(new Error("The first argument must be an image File or Blob object."));
        return;
      }
      if (!URL$1 || !FileReader) {
        this.fail(new Error("The current browser does not support image compression."));
        return;
      }
      if (!ArrayBuffer$1) {
        options2.checkOrientation = false;
        options2.retainExif = false;
      }
      var isJPEGImage = mimeType === "image/jpeg";
      var checkOrientation = isJPEGImage && options2.checkOrientation;
      var retainExif = isJPEGImage && options2.retainExif;
      if (URL$1 && !checkOrientation && !retainExif) {
        this.load({
          url: URL$1.createObjectURL(file)
        });
      } else {
        var reader = new FileReader();
        this.reader = reader;
        reader.onload = function(_ref) {
          var target = _ref.target;
          var result = target.result;
          var data = {};
          var orientation = 1;
          if (checkOrientation) {
            orientation = resetAndGetOrientation(result);
            if (orientation > 1) {
              _extends(data, parseOrientation(orientation));
            }
          }
          if (retainExif) {
            _this.exif = getExif(result);
          }
          if (checkOrientation || retainExif) {
            if (!URL$1 || orientation > 1) {
              data.url = arrayBufferToDataURL(result, mimeType);
            } else {
              data.url = URL$1.createObjectURL(file);
            }
          } else {
            data.url = result;
          }
          _this.load(data);
        };
        reader.onabort = function() {
          _this.fail(new Error("Aborted to read the image with FileReader."));
        };
        reader.onerror = function() {
          _this.fail(new Error("Failed to read the image with FileReader."));
        };
        reader.onloadend = function() {
          _this.reader = null;
        };
        if (checkOrientation || retainExif) {
          reader.readAsArrayBuffer(file);
        } else {
          reader.readAsDataURL(file);
        }
      }
    }
  }, {
    key: "load",
    value: function load(data) {
      var _this2 = this;
      var file = this.file, image = this.image;
      image.onload = function() {
        _this2.draw(_objectSpread2(_objectSpread2({}, data), {}, {
          naturalWidth: image.naturalWidth,
          naturalHeight: image.naturalHeight
        }));
      };
      image.onabort = function() {
        _this2.fail(new Error("Aborted to load the image."));
      };
      image.onerror = function() {
        _this2.fail(new Error("Failed to load the image."));
      };
      if (WINDOW.navigator && /(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(WINDOW.navigator.userAgent)) {
        image.crossOrigin = "anonymous";
      }
      image.alt = file.name;
      image.src = data.url;
    }
  }, {
    key: "draw",
    value: function draw(_ref2) {
      var _this3 = this;
      var naturalWidth = _ref2.naturalWidth, naturalHeight = _ref2.naturalHeight, _ref2$rotate = _ref2.rotate, rotate = _ref2$rotate === void 0 ? 0 : _ref2$rotate, _ref2$scaleX = _ref2.scaleX, scaleX = _ref2$scaleX === void 0 ? 1 : _ref2$scaleX, _ref2$scaleY = _ref2.scaleY, scaleY = _ref2$scaleY === void 0 ? 1 : _ref2$scaleY;
      var file = this.file, image = this.image, options2 = this.options;
      var canvas = document.createElement("canvas");
      var context = canvas.getContext("2d");
      var is90DegreesRotated = Math.abs(rotate) % 180 === 90;
      var resizable = (options2.resize === "contain" || options2.resize === "cover") && isPositiveNumber(options2.width) && isPositiveNumber(options2.height);
      var maxWidth = Math.max(options2.maxWidth, 0) || Infinity;
      var maxHeight = Math.max(options2.maxHeight, 0) || Infinity;
      var minWidth = Math.max(options2.minWidth, 0) || 0;
      var minHeight = Math.max(options2.minHeight, 0) || 0;
      var aspectRatio = naturalWidth / naturalHeight;
      var width = options2.width, height = options2.height;
      if (is90DegreesRotated) {
        var _ref3 = [maxHeight, maxWidth];
        maxWidth = _ref3[0];
        maxHeight = _ref3[1];
        var _ref4 = [minHeight, minWidth];
        minWidth = _ref4[0];
        minHeight = _ref4[1];
        var _ref5 = [height, width];
        width = _ref5[0];
        height = _ref5[1];
      }
      if (resizable) {
        aspectRatio = width / height;
      }
      var _getAdjustedSizes = getAdjustedSizes({
        aspectRatio,
        width: maxWidth,
        height: maxHeight
      }, "contain");
      maxWidth = _getAdjustedSizes.width;
      maxHeight = _getAdjustedSizes.height;
      var _getAdjustedSizes2 = getAdjustedSizes({
        aspectRatio,
        width: minWidth,
        height: minHeight
      }, "cover");
      minWidth = _getAdjustedSizes2.width;
      minHeight = _getAdjustedSizes2.height;
      if (resizable) {
        var _getAdjustedSizes3 = getAdjustedSizes({
          aspectRatio,
          width,
          height
        }, options2.resize);
        width = _getAdjustedSizes3.width;
        height = _getAdjustedSizes3.height;
      } else {
        var _getAdjustedSizes4 = getAdjustedSizes({
          aspectRatio,
          width,
          height
        });
        var _getAdjustedSizes4$wi = _getAdjustedSizes4.width;
        width = _getAdjustedSizes4$wi === void 0 ? naturalWidth : _getAdjustedSizes4$wi;
        var _getAdjustedSizes4$he = _getAdjustedSizes4.height;
        height = _getAdjustedSizes4$he === void 0 ? naturalHeight : _getAdjustedSizes4$he;
      }
      width = Math.floor(normalizeDecimalNumber(Math.min(Math.max(width, minWidth), maxWidth)));
      height = Math.floor(normalizeDecimalNumber(Math.min(Math.max(height, minHeight), maxHeight)));
      var destX = -width / 2;
      var destY = -height / 2;
      var destWidth = width;
      var destHeight = height;
      var params = [];
      if (resizable) {
        var srcX = 0;
        var srcY = 0;
        var srcWidth = naturalWidth;
        var srcHeight = naturalHeight;
        var _getAdjustedSizes5 = getAdjustedSizes({
          aspectRatio,
          width: naturalWidth,
          height: naturalHeight
        }, {
          contain: "cover",
          cover: "contain"
        }[options2.resize]);
        srcWidth = _getAdjustedSizes5.width;
        srcHeight = _getAdjustedSizes5.height;
        srcX = (naturalWidth - srcWidth) / 2;
        srcY = (naturalHeight - srcHeight) / 2;
        params.push(srcX, srcY, srcWidth, srcHeight);
      }
      params.push(destX, destY, destWidth, destHeight);
      if (is90DegreesRotated) {
        var _ref6 = [height, width];
        width = _ref6[0];
        height = _ref6[1];
      }
      canvas.width = width;
      canvas.height = height;
      if (!isImageType(options2.mimeType)) {
        options2.mimeType = file.type;
      }
      var fillStyle = "transparent";
      if (file.size > options2.convertSize && options2.convertTypes.indexOf(options2.mimeType) >= 0) {
        options2.mimeType = "image/jpeg";
      }
      var isJPEGImage = options2.mimeType === "image/jpeg";
      if (isJPEGImage) {
        fillStyle = "#fff";
      }
      context.fillStyle = fillStyle;
      context.fillRect(0, 0, width, height);
      if (options2.beforeDraw) {
        options2.beforeDraw.call(this, context, canvas);
      }
      if (this.aborted) {
        return;
      }
      context.save();
      context.translate(width / 2, height / 2);
      context.rotate(rotate * Math.PI / 180);
      context.scale(scaleX, scaleY);
      context.drawImage.apply(context, [image].concat(params));
      context.restore();
      if (options2.drew) {
        options2.drew.call(this, context, canvas);
      }
      if (this.aborted) {
        return;
      }
      var callback = function callback2(blob) {
        if (!_this3.aborted) {
          var done = function done2(result) {
            return _this3.done({
              naturalWidth,
              naturalHeight,
              result
            });
          };
          if (blob && isJPEGImage && options2.retainExif && _this3.exif && _this3.exif.length > 0) {
            var next = function next2(arrayBuffer) {
              return done(toBlob(arrayBufferToDataURL(insertExif(arrayBuffer, _this3.exif), options2.mimeType)));
            };
            if (blob.arrayBuffer) {
              blob.arrayBuffer().then(next).catch(function() {
                _this3.fail(new Error("Failed to read the compressed image with Blob.arrayBuffer()."));
              });
            } else {
              var reader = new FileReader();
              _this3.reader = reader;
              reader.onload = function(_ref7) {
                var target = _ref7.target;
                next(target.result);
              };
              reader.onabort = function() {
                _this3.fail(new Error("Aborted to read the compressed image with FileReader."));
              };
              reader.onerror = function() {
                _this3.fail(new Error("Failed to read the compressed image with FileReader."));
              };
              reader.onloadend = function() {
                _this3.reader = null;
              };
              reader.readAsArrayBuffer(blob);
            }
          } else {
            done(blob);
          }
        }
      };
      if (canvas.toBlob) {
        canvas.toBlob(callback, options2.mimeType, options2.quality);
      } else {
        callback(toBlob(canvas.toDataURL(options2.mimeType, options2.quality)));
      }
    }
  }, {
    key: "done",
    value: function done(_ref8) {
      var naturalWidth = _ref8.naturalWidth, naturalHeight = _ref8.naturalHeight, result = _ref8.result;
      var file = this.file, image = this.image, options2 = this.options;
      if (URL$1 && image.src.indexOf("blob:") === 0) {
        URL$1.revokeObjectURL(image.src);
      }
      if (result) {
        if (options2.strict && !options2.retainExif && result.size > file.size && options2.mimeType === file.type && !(options2.width > naturalWidth || options2.height > naturalHeight || options2.minWidth > naturalWidth || options2.minHeight > naturalHeight || options2.maxWidth < naturalWidth || options2.maxHeight < naturalHeight)) {
          result = file;
        } else {
          var date = /* @__PURE__ */ new Date();
          result.lastModified = date.getTime();
          result.lastModifiedDate = date;
          result.name = file.name;
          if (result.name && result.type !== file.type) {
            result.name = result.name.replace(REGEXP_EXTENSION, imageTypeToExtension(result.type));
          }
        }
      } else {
        result = file;
      }
      this.result = result;
      if (options2.success) {
        options2.success.call(this, result);
      }
    }
  }, {
    key: "fail",
    value: function fail(err) {
      var options2 = this.options;
      if (options2.error) {
        options2.error.call(this, err);
      } else {
        throw err;
      }
    }
  }, {
    key: "abort",
    value: function abort() {
      if (!this.aborted) {
        this.aborted = true;
        if (this.reader) {
          this.reader.abort();
        } else if (!this.image.complete) {
          this.image.onload = null;
          this.image.onabort();
        } else {
          this.fail(new Error("The compression process has been aborted."));
        }
      }
    }
    /**
     * Get the no conflict compressor class.
     * @returns {Compressor} The compressor class.
     */
  }], [{
    key: "noConflict",
    value: function noConflict() {
      window.Compressor = AnotherCompressor;
      return Compressor2;
    }
    /**
     * Change the default options.
     * @param {Object} options - The new default options.
     */
  }, {
    key: "setDefaults",
    value: function setDefaults(options2) {
      _extends(DEFAULTS, options2);
    }
  }]);
  return Compressor2;
}();
const mPicture_vue_vue_type_style_index_0_scoped_0476159c_lang = "";
const mPicture_vue_vue_type_style_index_1_lang = "";
const _sfc_main$l = {
  name: "MFileupload",
  props,
  emits: ["update:modelValue"],
  setup(props2, { emit }) {
    const { proxy } = getCurrentInstance();
    const showViewer = ref$1(false);
    const preview = computed(() => {
      return Array.isArray(fileList.value) && fileList.value.length > 0;
    });
    const previewIndex = ref$1(0);
    const imageIndex = computed(() => {
      if (previewIndex.value > fileList.value.length - 1) {
        return 0;
      }
      return previewIndex.value;
    });
    const previewSrcList = computed(() => {
      return fileList.value.map((s) => s.url);
    });
    const prevOverflow = "";
    function closeViewer() {
      document.body.style.overflow = prevOverflow;
      showViewer.value = false;
    }
    const accept = computed(() => {
      var ua = navigator.userAgent.toLowerCase();
      if (ua.indexOf("iphone") !== -1) {
        return "";
      }
      return "image/*";
    });
    const fileList = ref$1([]);
    const getFileList = computed(() => {
      const list = fileList.value.map((m) => {
        const { id, name, type: type2, size } = m;
        return { id, name, type: type2, size };
      });
      console.log("getFileList :>> ", list);
      return list;
    });
    const setFileList = (files) => {
      const addfiles = _.cloneDeep(files.filter((m) => !fileList.value.find((x) => x.id === m.id)));
      const { actionBlob } = props2.item.options;
      if (actionBlob) {
        addfiles.forEach((file) => {
          if (file.id && file.type.includes("image/")) {
            file.url = proxy.$axios.getUrl(actionBlob + "/" + file.id);
            file.isImage = true;
          }
        });
      }
      fileList.value.push(...addfiles);
      console.log("fileList.value :>> ", fileList.value);
    };
    const downloadFile = (file) => {
      const { actionBlob } = props2.item.options;
      proxy.$axios.download(actionBlob + "/" + file.id);
    };
    watch(
      () => props2.modelValue,
      (files) => {
        if (files) {
          setFileList(files);
        }
      },
      { immediate: true }
    );
    const handleRemove = (file) => {
      const { isDetail } = init(props2, emit);
      if (isDetail.value) {
        return false;
      }
      fileList.value.splice(fileList.value.indexOf(file), 1);
      emit("update:modelValue", getFileList.value);
    };
    const handlePictureCardPreview = (file) => {
      if (!preview.value)
        return;
      const index = fileList.value.findIndex((x) => x === file);
      previewIndex.value = index;
      document.body.style.overflow = "hidden";
      showViewer.value = true;
    };
    const fileMaxSize = computed(() => {
      return Number(props2.item.options.fileMaxSize || 5) * 1024 * 1024;
    });
    const handleBeforeUpload = (file) => new Promise((resolve, reject) => {
      const accept2 = props2.item.options.accept || "*";
      if (accept2 !== "*") {
        const extArrs = accept2.replace("，", ",").split(",");
        const extFileName = file.name.substring(file.name.lastIndexOf("."));
        if (!extArrs.includes(extFileName)) {
          if (props2.h5) {
            showToast(`不支持格式：${extFileName}`);
          } else {
            proxy.$message.error(`不支持格式：${extFileName}`);
          }
          reject();
        }
      }
      const fileMaxSize2 = props2.item.options.fileMaxSize || 5;
      if (file.size >= Number(fileMaxSize2) * 1024 * 1024) {
        if (props2.h5) {
          showToast(`文件大小已超出：${fileMaxSize2}MB`);
        } else {
          proxy.$message.error(`文件大小已超出：${fileMaxSize2}MB`);
        }
        reject();
      }
      if (props2.item.options.reduce && file.type.includes("image")) {
        new Compressor(file, {
          convertSize: 2e6,
          // 超出大小压缩
          maxWidth: props2.item.options.reduce === 2 ? 1440 : 3024,
          // 输出图像最大宽度
          quality: props2.item.options.reduce === 2 ? 0.8 : 0.9,
          // 压缩质量
          success: resolve,
          error(err) {
            console.log(err.message);
            if (props2.h5) {
              showToast("图片压缩错误！");
            } else {
              proxy.$message.error("图片压缩错误！");
            }
            reject();
          }
        });
      } else {
        resolve();
      }
    });
    const handleOnSuccess = (response, uploadFile, uploadFiles) => {
      const { id } = response;
      if (id)
        uploadFile.id = id;
      uploadFile.type = uploadFile.raw.type;
      console.log("uploadFile :>> ", uploadFile);
      const list = uploadFiles.map((m) => {
        const { id: id2, name, type: type2, size } = m;
        return { id: id2, name, type: type2, size };
      });
      emit("update:modelValue", list);
    };
    const handleOnError = () => {
      proxy.$message.error("上传失败！");
    };
    const handleOnExceed = () => {
      proxy.$message.error(`最大上传数量(${props2.item.options.limit})已超出.`);
    };
    const handleHttpRequest = (options2) => {
      console.log("options :>> ", options2, fileList);
      const file = fileList.value.find((m) => m.uid === options2.file.uid);
      file.status = "uploading";
      file.size = options2.file.size;
      const config = {
        // axios 1.3.4 更新
        headers: {
          "Content-Type": "multipart/form-data"
        },
        "Content-Type": "multipart/form-data",
        timeout: 999999,
        onUploadProgress: (progressEvent) => {
          file.percentage = Number((progressEvent.loaded / progressEvent.total * 100).toFixed(2));
        }
      };
      const formdata = new FormData();
      formdata.append("file", options2.file);
      proxy.$axios.post(options2.action, formdata, config).then((res) => {
        file.progress = "success";
        options2.onSuccess(res);
      }).catch((error) => {
        console.log("error :>> ", error);
        file.progress = "warning";
        options2.onError(error);
      });
    };
    const afterRead = (content) => {
      console.log("content :>> ", content);
      content.name = content.file.name;
      content.type = content.file.type;
      content.size = content.file.size;
      content.status = "uploading";
      content.message = "上传中...";
      const config = {
        // axios 1.3.4 更新
        headers: {
          "Content-Type": "multipart/form-data"
        },
        "Content-Type": "multipart/form-data",
        timeout: 999999
      };
      const formdata = new FormData();
      formdata.append("file", content.file);
      proxy.$axios.post(props2.item.options.action, formdata, config).then((res) => {
        content.id = res.id;
        content.status = "done";
        content.message = "";
        emit("update:modelValue", getFileList.value);
      }).catch((error) => {
        console.log("error :>> ", error);
        handleRemove(content);
        showToast("上传失败！");
      });
    };
    const hiddenUploadBtn = computed(() => {
      if (props2.item.options.camera) {
        return true;
      }
      return fileList.value.length >= props2.item.options.limit;
    });
    const onClickPreview = (file) => {
      if (!file.isImage) {
        const { actionBlob } = props2.item.options;
        const remoteUrl = proxy.$axios.getUrl(actionBlob + "/" + file.id);
        const extFileName = file.name.substring(file.name.lastIndexOf(".") + 1);
        const params = {
          fileName: file.uid || file.id,
          // 文件名
          fileType: extFileName,
          // 文件类型  doc, docx, xls, xlsx, ppt, pptx, pdf
          url: location.origin + remoteUrl
          // 下载资源的 url，完整的url地址 https://xxxxxx.xx
        };
        if (window.ECampus) {
          window.ECampus.downloadFile(params);
        } else {
          proxy.$axios.download(actionBlob + "/" + file.id);
        }
      }
    };
    return {
      preview,
      imageIndex,
      showViewer,
      previewSrcList,
      fileList,
      accept,
      hiddenUploadBtn,
      fileMaxSize,
      afterRead,
      getFileType,
      isImageType: isImageType$1,
      getIconByFileType,
      downloadFile,
      savePicture,
      closeViewer,
      handleRemove,
      handlePictureCardPreview,
      handleBeforeUpload,
      handleOnSuccess,
      handleOnError,
      handleOnExceed,
      handleHttpRequest,
      onClickPreview,
      ...init(props2, emit)
    };
  }
};
const _hoisted_1$l = { key: 0 };
const _hoisted_2$f = { class: "van-uploader__upload" };
const _hoisted_3$a = { class: "van-uploader__tip" };
const _hoisted_4$6 = {
  key: 0,
  class: "preview-cover-file-icon"
};
const _hoisted_5$4 = { class: "flex-center" };
const _hoisted_6$2 = ["src"];
const _hoisted_7$2 = {
  key: 1,
  class: "ep-preview-cover-file-icon"
};
const _hoisted_8$2 = { class: "el-upload-list__item-actions" };
const _hoisted_9$2 = ["onClick"];
const _hoisted_10$2 = ["onClick"];
const _hoisted_11$2 = ["onClick"];
const _hoisted_12$2 = {
  key: 0,
  class: "el-upload__tip"
};
function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
  var _a2;
  const _component_van_icon = resolveComponent("van-icon");
  const _component_m_icon = resolveComponent("m-icon");
  const _component_van_uploader = resolveComponent("van-uploader");
  const _component_van_field = resolveComponent("van-field");
  const _component_Plus = resolveComponent("Plus");
  const _component_el_icon = resolveComponent("el-icon");
  const _component_el_progress = resolveComponent("el-progress");
  const _component_ZoomIn = resolveComponent("ZoomIn");
  const _component_Download = resolveComponent("Download");
  const _component_Delete = resolveComponent("Delete");
  const _component_el_upload = resolveComponent("el-upload");
  const _component_widget_form_item = resolveComponent("widget-form-item");
  const _component_image_viewer = resolveComponent("image-viewer");
  return openBlock(), createElementBlock(Fragment, null, [
    _ctx.h5 ? (openBlock(), createElementBlock("div", _hoisted_1$l, [
      $setup.fileList.length > 0 || !_ctx.isDetail ? (openBlock(), createBlock(_component_van_field, {
        key: 0,
        class: "m-van-cell",
        name: _ctx.item.options && _ctx.item.options.name,
        label: _ctx.item.options && _ctx.item.options.label,
        required: _ctx.item.options && !_ctx.isDetail && _ctx.item.options.required,
        rules: _ctx.isDetail ? [] : _ctx.rules,
        border: false,
        "label-width": ((_a2 = _ctx.item.options) == null ? void 0 : _a2.labelPosition) === "top" ? "100%" : void 0,
        "label-align": _ctx.item.options && _ctx.item.options.labelPosition || void 0,
        "input-align": _ctx.item.options && _ctx.item.options.inputAlign || void 0,
        readonly: "",
        autocomplete: "off"
      }, {
        input: withCtx(() => [
          createVNode(_component_van_uploader, {
            modelValue: $setup.fileList,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.fileList = $event),
            "max-count": _ctx.isDetail ? 0 : _ctx.item.options && _ctx.item.options.limit,
            "max-size": $setup.fileMaxSize,
            accept: $setup.accept,
            capture: _ctx.item.options.camera ? "camera" : void 0,
            "before-read": $setup.handleBeforeUpload,
            "after-read": $setup.afterRead,
            "before-delete": $setup.handleRemove,
            deletable: !_ctx.isDetail,
            disabled: _ctx.item.options && _ctx.item.options.disabled,
            "preview-options": { closeable: true, showIndex: false },
            class: "picture-card",
            "result-type": "dataUrl",
            onClickPreview: $setup.onClickPreview
          }, {
            "preview-cover": withCtx(({ type: type2 }) => [
              !$setup.isImageType({ type: type2 }) ? (openBlock(), createElementBlock("div", _hoisted_4$6, [
                createVNode(_component_m_icon, {
                  name: $setup.getIconByFileType({ type: type2 })
                }, null, 8, ["name"])
              ])) : createCommentVNode("", true)
            ]),
            default: withCtx(() => [
              createElementVNode("div", _hoisted_2$f, [
                createVNode(_component_van_icon, {
                  name: "photograph",
                  class: "van-uploader__upload-icon"
                }),
                createElementVNode("div", _hoisted_3$a, toDisplayString(_ctx.item.options.tip), 1)
              ])
            ]),
            _: 1
          }, 8, ["modelValue", "max-count", "max-size", "accept", "capture", "before-read", "after-read", "before-delete", "deletable", "disabled", "onClickPreview"])
        ]),
        _: 1
      }, 8, ["name", "label", "required", "rules", "label-width", "label-align", "input-align"])) : createCommentVNode("", true)
    ])) : (openBlock(), createBlock(_component_widget_form_item, {
      key: 1,
      class: "ep-fileupload",
      designer: _ctx.designer,
      "widget-list": _ctx.widgetList,
      item: _ctx.item,
      rules: _ctx.item.options.camera || _ctx.isDetail ? [] : _ctx.rules,
      index: _ctx.index,
      "show-message": !_ctx.isDetail
    }, {
      default: withCtx(() => [
        createVNode(_component_el_upload, {
          "file-list": $setup.fileList,
          "onUpdate:fileList": _cache[1] || (_cache[1] = ($event) => $setup.fileList = $event),
          style: { width: "100%" },
          class: normalizeClass([{ hiddenUploadBtn: $setup.hiddenUploadBtn }]),
          accept: $setup.accept,
          action: _ctx.item.options && _ctx.item.options.action,
          disabled: _ctx.item.options && _ctx.item.options.disabled || _ctx.item.options.camera,
          limit: _ctx.item.options && _ctx.item.options.limit,
          "list-type": "picture-card",
          "before-upload": $setup.handleBeforeUpload,
          "on-success": $setup.handleOnSuccess,
          "on-error": $setup.handleOnError,
          "on-exceed": $setup.handleOnExceed,
          "http-request": $setup.handleHttpRequest
        }, {
          file: withCtx(({ file }) => [
            createElementVNode("div", _hoisted_5$4, [
              $setup.isImageType(file) ? (openBlock(), createElementBlock("img", {
                key: 0,
                class: "el-upload-list__item-thumbnail",
                src: file.url,
                alt: ""
              }, null, 8, _hoisted_6$2)) : (openBlock(), createElementBlock("div", _hoisted_7$2, [
                createVNode(_component_m_icon, {
                  name: $setup.getIconByFileType(file)
                }, null, 8, ["name"])
              ])),
              file.status === "uploading" ? (openBlock(), createBlock(_component_el_progress, {
                key: 2,
                type: "circle",
                width: 90,
                "stroke-width": 5,
                percentage: Number(file.percentage || 0),
                style: { "display": "flex", "justify-content": "center", "align-items": "center" }
              }, null, 8, ["percentage"])) : createCommentVNode("", true),
              createElementVNode("span", _hoisted_8$2, [
                $setup.getFileType(file).includes("image/") ? (openBlock(), createElementBlock("span", {
                  key: 0,
                  class: "el-upload-list__item-preview",
                  onClick: ($event) => $setup.handlePictureCardPreview(file)
                }, [
                  createVNode(_component_el_icon, null, {
                    default: withCtx(() => [
                      createVNode(_component_ZoomIn)
                    ]),
                    _: 1
                  })
                ], 8, _hoisted_9$2)) : createCommentVNode("", true),
                _ctx.isDetail ? (openBlock(), createElementBlock("span", {
                  key: 1,
                  class: "el-upload-list__item-download",
                  onClick: ($event) => $setup.downloadFile(file)
                }, [
                  createVNode(_component_el_icon, null, {
                    default: withCtx(() => [
                      createVNode(_component_Download)
                    ]),
                    _: 1
                  })
                ], 8, _hoisted_10$2)) : createCommentVNode("", true),
                !_ctx.isDetail ? (openBlock(), createElementBlock("span", {
                  key: 2,
                  class: "el-upload-list__item-delete",
                  onClick: ($event) => $setup.handleRemove(file)
                }, [
                  createVNode(_component_el_icon, null, {
                    default: withCtx(() => [
                      createVNode(_component_Delete)
                    ]),
                    _: 1
                  })
                ], 8, _hoisted_11$2)) : createCommentVNode("", true)
              ])
            ])
          ]),
          tip: withCtx(() => [
            _ctx.item.options.tip && !_ctx.isDetail ? (openBlock(), createElementBlock("div", _hoisted_12$2, toDisplayString(_ctx.item.options.tip), 1)) : createCommentVNode("", true)
          ]),
          default: withCtx(() => [
            !_ctx.isDetail && !$setup.hiddenUploadBtn ? (openBlock(), createBlock(_component_el_icon, { key: 0 }, {
              default: withCtx(() => [
                createVNode(_component_Plus)
              ]),
              _: 1
            })) : createCommentVNode("", true)
          ]),
          _: 1
        }, 8, ["file-list", "class", "accept", "action", "disabled", "limit", "before-upload", "on-success", "on-error", "on-exceed", "http-request"])
      ]),
      _: 1
    }, 8, ["designer", "widget-list", "item", "rules", "index", "show-message"])),
    $setup.preview ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
      $setup.showViewer ? (openBlock(), createBlock(_component_image_viewer, {
        key: 0,
        teleported: true,
        "initial-index": $setup.imageIndex,
        "url-list": $setup.previewSrcList,
        onClose: $setup.closeViewer
      }, null, 8, ["initial-index", "url-list", "onClose"])) : createCommentVNode("", true)
    ], 64)) : createCommentVNode("", true)
  ], 64);
}
const mPicture = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$k], ["__scopeId", "data-v-0476159c"]]);
const _sfc_main$k = {
  name: "MInput",
  props,
  emits: ["update:modelValue"],
  setup(props2, { emit }) {
    const append = computed(() => {
      if (props2.item.options.append) {
        return props2.item.options.append;
      }
      return "";
    });
    const formFields = computed(() => {
      const arr = props2.widgetList.filter((x) => ExcelFields.includes(x.type) && x.id !== props2.item.id);
      const card2 = props2.widgetList.find((x) => x.type === "card");
      if (card2 && Array.isArray(card2.components)) {
        const components2 = card2.components.filter((x) => ExcelFields.includes(x.type) && x.id !== props2.item.id);
        arr.push(...components2);
      }
      return arr;
    });
    const card = props2.widgetList.find((x) => x.type === "card");
    const CONFIG = {
      publicVars: (card == null ? void 0 : card.options.publicVars) || {},
      formula: props2.item.options.defaultValueFunc
    };
    const refundService = new ExcelFormulaParserService(CONFIG);
    watch(
      () => _.cloneDeep(props2.formData),
      (newValue, oldValue) => {
        if (props2.item.options.defaultValueFunc && props2.item.options.defaultValueType === 1) {
          const cleanedObj1 = _.omit(newValue, props2.item.options.name);
          const cleanedObj2 = _.omit(oldValue, props2.item.options.name);
          const isEqual = _.isEqual(cleanedObj1, cleanedObj2);
          if (!isEqual) {
            const result = refundService.parse(formFields.value, newValue);
            emit("update:modelValue", String(result));
          }
        }
      },
      { deep: true }
    );
    return {
      append,
      ...init(props2, emit)
    };
  }
};
const _hoisted_1$k = { key: 1 };
const _hoisted_2$e = {
  key: 0,
  style: { "padding-left": "8px" }
};
function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
  var _a2;
  const _component_van_field = resolveComponent("van-field");
  const _component_el_input = resolveComponent("el-input");
  const _component_widget_form_item = resolveComponent("widget-form-item");
  return _ctx.h5 ? withDirectives((openBlock(), createBlock(_component_van_field, {
    key: 0,
    modelValue: _ctx.fieldModel,
    "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.fieldModel = $event),
    type: "text",
    name: _ctx.item.options && _ctx.item.options.name,
    label: _ctx.item.options && _ctx.item.options.label,
    disabled: _ctx.item.options && _ctx.item.options.disabled,
    readonly: _ctx.isDetail || _ctx.designer || _ctx.item.options && _ctx.item.options.readonly,
    placeholder: _ctx.isDetail ? "" : _ctx.item.options && _ctx.item.options.placeholder,
    clearable: _ctx.item.options && _ctx.item.options.clearable,
    maxlength: _ctx.item.options && _ctx.item.options.maxlength || void 0,
    "show-word-limit": _ctx.item.options && !_ctx.isDetail && _ctx.item.options.showWordLimit,
    required: _ctx.item.options && !_ctx.isDetail && _ctx.item.options.required,
    rules: _ctx.isDetail ? [] : _ctx.rules,
    border: false,
    "label-width": ((_a2 = _ctx.item.options) == null ? void 0 : _a2.labelPosition) === "top" ? "100%" : void 0,
    "label-align": _ctx.item.options && _ctx.item.options.labelPosition || void 0,
    "input-align": _ctx.item.options && _ctx.item.options.inputAlign || void 0,
    autocomplete: "off"
  }, createSlots({ _: 2 }, [
    $setup.append ? {
      name: "button",
      fn: withCtx(() => [
        createTextVNode(toDisplayString($setup.append), 1)
      ]),
      key: "0"
    } : void 0
  ]), 1032, ["modelValue", "name", "label", "disabled", "readonly", "placeholder", "clearable", "maxlength", "show-word-limit", "required", "rules", "label-width", "label-align", "input-align"])), [
    [vShow, _ctx.designer || _ctx.item.options && !_ctx.item.options.hidden]
  ]) : withDirectives((openBlock(), createBlock(_component_widget_form_item, {
    key: 1,
    designer: _ctx.designer,
    "widget-list": _ctx.widgetList,
    item: _ctx.item,
    rules: _ctx.isDetail ? [] : _ctx.rules,
    index: _ctx.index,
    "show-message": !_ctx.isDetail
  }, {
    default: withCtx(() => [
      !_ctx.isDetail ? (openBlock(), createBlock(_component_el_input, {
        key: 0,
        modelValue: _ctx.fieldModel,
        "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.fieldModel = $event),
        type: "text",
        disabled: _ctx.item.options && _ctx.item.options.disabled,
        readonly: _ctx.designer || _ctx.item.options && _ctx.item.options.readonly,
        placeholder: _ctx.item.options && _ctx.item.options.placeholder,
        clearable: _ctx.item.options && _ctx.item.options.clearable,
        maxlength: _ctx.item.options && _ctx.item.options.maxlength,
        "show-word-limit": _ctx.item.options && _ctx.item.options.showWordLimit
      }, createSlots({ _: 2 }, [
        $setup.append ? {
          name: "append",
          fn: withCtx(() => [
            createTextVNode(toDisplayString($setup.append), 1)
          ]),
          key: "0"
        } : void 0
      ]), 1032, ["modelValue", "disabled", "readonly", "placeholder", "clearable", "maxlength", "show-word-limit"])) : (openBlock(), createElementBlock("div", _hoisted_1$k, [
        createTextVNode(toDisplayString(_ctx.fieldModel) + " ", 1),
        $setup.append ? (openBlock(), createElementBlock("span", _hoisted_2$e, toDisplayString($setup.append), 1)) : createCommentVNode("", true)
      ]))
    ]),
    _: 1
  }, 8, ["designer", "widget-list", "item", "rules", "index", "show-message"])), [
    [vShow, _ctx.designer || _ctx.item.options && !_ctx.item.options.hidden]
  ]);
}
const mInput = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$j]]);
const _sfc_main$j = {
  name: "MInput",
  props,
  emits: ["update:modelValue"],
  setup(props2, { emit }) {
    const append = computed(() => {
      if (props2.item.options.append) {
        return props2.item.options.append;
      }
      return "";
    });
    const limitInput = (val) => {
      const limitMin = props2.item.options.min || 0;
      const limitMax = props2.item.options.max || 9;
      if (val > limitMax) {
        emit("update:modelValue", limitMax);
        return false;
      }
      if (val < limitMin) {
        emit("update:modelValue", limitMin);
        return false;
      }
      return true;
    };
    return {
      append,
      limitInput,
      ...init(props2, emit)
    };
  }
};
const _hoisted_1$j = { key: 1 };
const _hoisted_2$d = {
  key: 0,
  style: { "padding-left": "8px" }
};
function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
  var _a2;
  const _component_van_field = resolveComponent("van-field");
  const _component_el_input = resolveComponent("el-input");
  const _component_widget_form_item = resolveComponent("widget-form-item");
  return _ctx.h5 ? withDirectives((openBlock(), createBlock(_component_van_field, {
    key: 0,
    modelValue: _ctx.fieldModel,
    "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.fieldModel = $event),
    type: "number",
    name: _ctx.item.options && _ctx.item.options.name,
    label: _ctx.item.options && _ctx.item.options.label,
    disabled: _ctx.item.options && _ctx.item.options.disabled,
    readonly: _ctx.isDetail || _ctx.designer || _ctx.item.options && _ctx.item.options.readonly,
    placeholder: _ctx.isDetail ? "" : _ctx.item.options && _ctx.item.options.placeholder,
    required: _ctx.item.options && !_ctx.isDetail && _ctx.item.options.required,
    rules: _ctx.isDetail ? [] : _ctx.rules,
    border: false,
    "label-width": ((_a2 = _ctx.item.options) == null ? void 0 : _a2.labelPosition) === "top" ? "100%" : void 0,
    "label-align": _ctx.item.options && _ctx.item.options.labelPosition || void 0,
    "input-align": _ctx.item.options && _ctx.item.options.inputAlign || void 0,
    autocomplete: "off",
    onBlur: _cache[1] || (_cache[1] = ($event) => $setup.limitInput(_ctx.fieldModel))
  }, createSlots({ _: 2 }, [
    $setup.append ? {
      name: "button",
      fn: withCtx(() => [
        createTextVNode(toDisplayString($setup.append), 1)
      ]),
      key: "0"
    } : void 0
  ]), 1032, ["modelValue", "name", "label", "disabled", "readonly", "placeholder", "required", "rules", "label-width", "label-align", "input-align"])), [
    [vShow, _ctx.designer || _ctx.item.options && !_ctx.item.options.hidden]
  ]) : withDirectives((openBlock(), createBlock(_component_widget_form_item, {
    key: 1,
    designer: _ctx.designer,
    "widget-list": _ctx.widgetList,
    item: _ctx.item,
    rules: _ctx.isDetail ? [] : _ctx.rules,
    index: _ctx.index,
    "show-message": !_ctx.isDetail
  }, {
    default: withCtx(() => [
      !_ctx.isDetail ? (openBlock(), createBlock(_component_el_input, {
        key: 0,
        modelValue: _ctx.fieldModel,
        "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.fieldModel = $event),
        type: "number",
        disabled: _ctx.item.options && _ctx.item.options.disabled,
        readonly: _ctx.designer || _ctx.item.options && _ctx.item.options.readonly,
        placeholder: _ctx.item.options && _ctx.item.options.placeholder,
        min: _ctx.item.options && _ctx.item.options.min,
        max: _ctx.item.options && _ctx.item.options.max,
        onBlur: _cache[3] || (_cache[3] = ($event) => $setup.limitInput(_ctx.fieldModel))
      }, createSlots({ _: 2 }, [
        $setup.append ? {
          name: "append",
          fn: withCtx(() => [
            createTextVNode(toDisplayString($setup.append), 1)
          ]),
          key: "0"
        } : void 0
      ]), 1032, ["modelValue", "disabled", "readonly", "placeholder", "min", "max"])) : (openBlock(), createElementBlock("div", _hoisted_1$j, [
        createTextVNode(toDisplayString(_ctx.fieldModel) + " ", 1),
        $setup.append ? (openBlock(), createElementBlock("span", _hoisted_2$d, toDisplayString($setup.append), 1)) : createCommentVNode("", true)
      ]))
    ]),
    _: 1
  }, 8, ["designer", "widget-list", "item", "rules", "index", "show-message"])), [
    [vShow, _ctx.designer || _ctx.item.options && !_ctx.item.options.hidden]
  ]);
}
const mNumber = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$i]]);
const _sfc_main$i = {
  name: "MRadio",
  props,
  emits: ["update:modelValue"],
  setup(props2, { emit }) {
    const fieldModel = computed({
      get() {
        return props2.modelValue;
      },
      set(val) {
        emit("update:modelValue", val);
      }
    });
    const fieldModelText = computed(() => {
      if (Array.isArray(props2.item.options.optionItems)) {
        const option = props2.item.options.optionItems.find((x) => x.value === fieldModel.value);
        if (option) {
          return option.label;
        }
      }
      return "--";
    });
    return {
      ...init(props2, emit),
      fieldModelText
    };
  }
};
const _hoisted_1$i = { key: 1 };
const _hoisted_2$c = { key: 1 };
function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
  var _a2;
  const _component_van_radio = resolveComponent("van-radio");
  const _component_van_radio_group = resolveComponent("van-radio-group");
  const _component_van_field = resolveComponent("van-field");
  const _component_el_radio = resolveComponent("el-radio");
  const _component_el_radio_group = resolveComponent("el-radio-group");
  const _component_widget_form_item = resolveComponent("widget-form-item");
  return _ctx.h5 ? (openBlock(), createBlock(_component_van_field, {
    key: 0,
    name: _ctx.item.options && _ctx.item.options.name,
    label: _ctx.item.options && _ctx.item.options.label,
    required: _ctx.item.options && !_ctx.isDetail && _ctx.item.options.required,
    rules: _ctx.isDetail ? [] : _ctx.rules,
    border: false,
    "label-width": ((_a2 = _ctx.item.options) == null ? void 0 : _a2.labelPosition) === "top" ? "100%" : void 0,
    "label-align": _ctx.item.options && _ctx.item.options.labelPosition || void 0,
    "input-align": _ctx.item.options && _ctx.item.options.inputAlign || void 0,
    autocomplete: "off"
  }, {
    input: withCtx(() => [
      !_ctx.isDetail ? (openBlock(), createBlock(_component_van_radio_group, {
        key: 0,
        modelValue: _ctx.fieldModel,
        "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.fieldModel = $event),
        disabled: _ctx.isDetail || _ctx.item.options && _ctx.item.options.disabled,
        direction: _ctx.item.options && _ctx.item.options.inline ? "horizontal" : "vertical"
      }, {
        default: withCtx(() => [
          (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.item.options.optionItems, (r, i) => {
            return openBlock(), createBlock(_component_van_radio, {
              key: i,
              name: r.value,
              disabled: r.disabled,
              style: { "margin": "6px 12px" }
            }, {
              default: withCtx(() => [
                createTextVNode(toDisplayString(r.label), 1)
              ]),
              _: 2
            }, 1032, ["name", "disabled"]);
          }), 128))
        ]),
        _: 1
      }, 8, ["modelValue", "disabled", "direction"])) : (openBlock(), createElementBlock("div", _hoisted_1$i, toDisplayString($setup.fieldModelText), 1))
    ]),
    _: 1
  }, 8, ["name", "label", "required", "rules", "label-width", "label-align", "input-align"])) : (openBlock(), createBlock(_component_widget_form_item, {
    key: 1,
    designer: _ctx.designer,
    "widget-list": _ctx.widgetList,
    item: _ctx.item,
    rules: _ctx.isDetail ? [] : _ctx.rules,
    index: _ctx.index,
    "show-message": !_ctx.isDetail
  }, {
    default: withCtx(() => [
      !_ctx.isDetail ? (openBlock(), createBlock(_component_el_radio_group, {
        key: 0,
        modelValue: _ctx.fieldModel,
        "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.fieldModel = $event),
        disabled: _ctx.isDetail || _ctx.item.options && _ctx.item.options.disabled
      }, {
        default: withCtx(() => [
          (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.item.options.optionItems, (r, i) => {
            return openBlock(), createBlock(_component_el_radio, {
              key: i,
              label: r.value,
              value: r.value,
              disabled: r.disabled,
              style: normalizeStyle({ width: _ctx.item.options.inline ? "auto" : "100%" })
            }, {
              default: withCtx(() => [
                createTextVNode(toDisplayString(r.label), 1)
              ]),
              _: 2
            }, 1032, ["label", "value", "disabled", "style"]);
          }), 128))
        ]),
        _: 1
      }, 8, ["modelValue", "disabled"])) : (openBlock(), createElementBlock("div", _hoisted_2$c, toDisplayString($setup.fieldModelText), 1))
    ]),
    _: 1
  }, 8, ["designer", "widget-list", "item", "rules", "index", "show-message"]));
}
const mRadio = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$h]]);
const _sfc_main$h = {
  name: "MSelect",
  props,
  emits: ["update:modelValue"],
  setup(props2, { emit }) {
    const showPicker = ref$1(false);
    const valueTxt = ref$1("");
    const customFieldName = {
      text: "label",
      children: "children"
    };
    const options2 = computed(() => props2.item.options);
    watch(
      () => props2.modelValue,
      (val) => {
        if (val) {
          const item = options2.value.optionItems.find((p) => p.value === val);
          if (item) {
            valueTxt.value = item.label || "";
          }
        } else {
          valueTxt.value = "";
        }
      },
      { immediate: true }
    );
    const onConfirm = ({ selectedOptions }) => {
      if (selectedOptions) {
        emit("update:modelValue", selectedOptions[0].value);
        valueTxt.value = selectedOptions[0].label;
      }
      showPicker.value = false;
    };
    const onShowPicker = () => {
      const { isDetail } = init(props2, emit);
      if (!options2.value.readonly && !options2.value.disabled && !isDetail.value) {
        showPicker.value = true;
      }
    };
    return {
      showPicker,
      valueTxt,
      customFieldName,
      onConfirm,
      onShowPicker,
      ...init(props2, emit)
    };
  }
};
const _hoisted_1$h = { key: 1 };
function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
  var _a2;
  const _component_van_field = resolveComponent("van-field");
  const _component_el_option = resolveComponent("el-option");
  const _component_el_select = resolveComponent("el-select");
  const _component_widget_form_item = resolveComponent("widget-form-item");
  const _component_van_picker = resolveComponent("van-picker");
  const _component_van_popup = resolveComponent("van-popup");
  return openBlock(), createElementBlock(Fragment, null, [
    _ctx.h5 ? (openBlock(), createBlock(_component_van_field, {
      key: 0,
      modelValue: $setup.valueTxt,
      "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.valueTxt = $event),
      "is-link": !_ctx.isDetail,
      readonly: "",
      name: _ctx.item.options && _ctx.item.options.name,
      label: _ctx.item.options && _ctx.item.options.label,
      disabled: _ctx.item.options && _ctx.item.options.disabled,
      placeholder: _ctx.isDetail ? "" : _ctx.item.options && _ctx.item.options.placeholder,
      clearable: _ctx.item.options && _ctx.item.options.clearable,
      required: _ctx.item.options && !_ctx.isDetail && _ctx.item.options.required,
      rules: _ctx.isDetail ? [] : _ctx.rules,
      border: false,
      "label-width": ((_a2 = _ctx.item.options) == null ? void 0 : _a2.labelPosition) === "top" ? "100%" : void 0,
      "label-align": _ctx.item.options && _ctx.item.options.labelPosition || void 0,
      "input-align": _ctx.item.options && _ctx.item.options.inputAlign || void 0,
      onClick: $setup.onShowPicker
    }, null, 8, ["modelValue", "is-link", "name", "label", "disabled", "placeholder", "clearable", "required", "rules", "label-width", "label-align", "input-align", "onClick"])) : (openBlock(), createBlock(_component_widget_form_item, {
      key: 1,
      designer: _ctx.designer,
      "widget-list": _ctx.widgetList,
      item: _ctx.item,
      rules: _ctx.isDetail ? [] : _ctx.rules,
      index: _ctx.index,
      "show-message": !_ctx.isDetail
    }, {
      default: withCtx(() => [
        !_ctx.isDetail ? (openBlock(), createBlock(_component_el_select, {
          key: 0,
          modelValue: _ctx.fieldModel,
          "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.fieldModel = $event),
          "value-key": "value",
          style: { "flex": "1" },
          disabled: _ctx.item.options && _ctx.item.options.disabled,
          placeholder: _ctx.item.options && _ctx.item.options.placeholder,
          clearable: _ctx.item.options && _ctx.item.options.clearable
        }, {
          default: withCtx(() => [
            (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.item.options.optionItems, (r, i) => {
              return openBlock(), createBlock(_component_el_option, {
                key: i,
                label: r.label,
                value: r.value
              }, null, 8, ["label", "value"]);
            }), 128))
          ]),
          _: 1
        }, 8, ["modelValue", "disabled", "placeholder", "clearable"])) : (openBlock(), createElementBlock("div", _hoisted_1$h, toDisplayString($setup.valueTxt), 1))
      ]),
      _: 1
    }, 8, ["designer", "widget-list", "item", "rules", "index", "show-message"])),
    createVNode(_component_van_popup, {
      show: $setup.showPicker,
      "onUpdate:show": _cache[3] || (_cache[3] = ($event) => $setup.showPicker = $event),
      round: "",
      position: "bottom"
    }, {
      default: withCtx(() => [
        createVNode(_component_van_picker, {
          columns: _ctx.item.options.optionItems,
          "columns-field-names": $setup.customFieldName,
          title: _ctx.item.options.label,
          onConfirm: $setup.onConfirm,
          onCancel: _cache[2] || (_cache[2] = ($event) => $setup.showPicker = false)
        }, null, 8, ["columns", "columns-field-names", "title", "onConfirm"])
      ]),
      _: 1
    }, 8, ["show"])
  ], 64);
}
const mSelect = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$g]]);
const _sfc_main$g = {
  name: "MDivider",
  props,
  emits: ["update:modelValue"],
  setup(props2, { emit }) {
    const lineStyle = computed(() => {
      if (props2.item.options.lineStyle === "dashed") {
        return "dashed";
      }
      return "double";
    });
    const isDashed = computed(() => {
      return props2.item.options.lineStyle === "dashed";
    });
    const vertical = computed(() => {
      return props2.item.options.direction === "vertical";
    });
    return {
      ...init(props2, emit),
      lineStyle,
      isDashed,
      vertical
    };
  }
};
const _hoisted_1$g = { key: 0 };
function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_van_divider = resolveComponent("van-divider");
  const _component_el_divider = resolveComponent("el-divider");
  const _component_widget_form_item = resolveComponent("widget-form-item");
  return _ctx.h5 ? (openBlock(), createElementBlock("div", _hoisted_1$g, [
    _ctx.item.options.title ? (openBlock(), createBlock(_component_van_divider, {
      key: 0,
      "content-position": _ctx.item.options.titlePosition,
      dashed: $setup.isDashed,
      vertical: $setup.vertical,
      hairline: false
    }, {
      default: withCtx(() => [
        createTextVNode(toDisplayString(_ctx.item.options.title), 1)
      ]),
      _: 1
    }, 8, ["content-position", "dashed", "vertical"])) : (openBlock(), createBlock(_component_van_divider, {
      key: 1,
      "content-position": _ctx.item.options.titlePosition,
      dashed: $setup.isDashed,
      vertical: $setup.vertical,
      hairline: false
    }, null, 8, ["content-position", "dashed", "vertical"]))
  ])) : (openBlock(), createBlock(_component_widget_form_item, {
    key: 1,
    designer: _ctx.designer,
    "widget-list": _ctx.widgetList,
    item: _ctx.item,
    index: _ctx.index
  }, {
    default: withCtx(() => [
      createVNode(_component_el_divider, {
        direction: _ctx.item.options.direction,
        "content-position": _ctx.item.options.titlePosition,
        "border-style": $setup.lineStyle,
        style: { "margin": "12px 0" }
      }, {
        default: withCtx(() => [
          createTextVNode(toDisplayString(_ctx.item.options.title), 1)
        ]),
        _: 1
      }, 8, ["direction", "content-position", "border-style"])
    ]),
    _: 1
  }, 8, ["designer", "widget-list", "item", "index"]));
}
const mDivider = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$f]]);
const _sfc_main$f = {
  name: "MTextarea",
  props,
  emits: ["update:modelValue"],
  setup(props2, { emit }) {
    const autosize = computed(() => {
      if (props2.h5) {
        return props2.item.options.autosize;
      }
      if (props2.item.options.autosize) {
        return { minRows: props2.item.options.rows, maxRows: 7 };
      }
      return false;
    });
    return {
      autosize,
      ...init(props2, emit)
    };
  }
};
const _hoisted_1$f = { key: 1 };
function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
  var _a2;
  const _component_van_text_ellipsis = resolveComponent("van-text-ellipsis");
  const _component_van_field = resolveComponent("van-field");
  const _component_el_input = resolveComponent("el-input");
  const _component_widget_form_item = resolveComponent("widget-form-item");
  return _ctx.h5 ? (openBlock(), createBlock(_component_van_field, {
    key: _ctx.isDetail,
    modelValue: _ctx.fieldModel,
    "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.fieldModel = $event),
    type: "textarea",
    name: _ctx.item.options && _ctx.item.options.name,
    label: _ctx.item.options && _ctx.item.options.label,
    disabled: _ctx.item.options && _ctx.item.options.disabled,
    readonly: _ctx.isDetail || _ctx.designer || _ctx.item.options && _ctx.item.options.readonly,
    placeholder: _ctx.isDetail ? "" : _ctx.item.options && _ctx.item.options.placeholder,
    maxlength: _ctx.item.options && _ctx.item.options.maxlength || null,
    rows: _ctx.isDetail ? 1 : _ctx.item.options && _ctx.item.options.rows,
    "show-word-limit": _ctx.item.options && !_ctx.isDetail && _ctx.item.options.showWordLimit,
    autosize: $setup.autosize,
    required: _ctx.item.options && !_ctx.isDetail && _ctx.item.options.required,
    rules: _ctx.isDetail ? [] : _ctx.rules,
    border: false,
    "label-width": ((_a2 = _ctx.item.options) == null ? void 0 : _a2.labelPosition) === "top" ? "100%" : void 0,
    "label-align": _ctx.item.options && _ctx.item.options.labelPosition || void 0,
    "input-align": _ctx.item.options && _ctx.item.options.inputAlign || void 0,
    autocomplete: "off"
  }, createSlots({ _: 2 }, [
    _ctx.isDetail ? {
      name: "input",
      fn: withCtx(() => [
        _ctx.fieldModel ? (openBlock(), createBlock(_component_van_text_ellipsis, {
          key: 0,
          content: _ctx.fieldModel,
          rows: _ctx.item.options.ellipsis || 3,
          "expand-text": _ctx.item.options.expandTips || "展开",
          "collapse-text": _ctx.item.options.retractTips || "收起"
        }, null, 8, ["content", "rows", "expand-text", "collapse-text"])) : createCommentVNode("", true)
      ]),
      key: "0"
    } : void 0
  ]), 1032, ["modelValue", "name", "label", "disabled", "readonly", "placeholder", "maxlength", "rows", "show-word-limit", "autosize", "required", "rules", "label-width", "label-align", "input-align"])) : (openBlock(), createBlock(_component_widget_form_item, {
    key: 1,
    designer: _ctx.designer,
    "widget-list": _ctx.widgetList,
    item: _ctx.item,
    rules: _ctx.isDetail ? [] : _ctx.rules,
    index: _ctx.index,
    "show-message": !_ctx.isDetail
  }, {
    default: withCtx(() => [
      !_ctx.isDetail ? (openBlock(), createBlock(_component_el_input, {
        key: 0,
        modelValue: _ctx.fieldModel,
        "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.fieldModel = $event),
        type: "textarea",
        disabled: _ctx.item.options && _ctx.item.options.disabled,
        readonly: _ctx.designer || _ctx.item.options && _ctx.item.options.readonly,
        placeholder: _ctx.item.options && _ctx.item.options.placeholder,
        maxlength: _ctx.item.options && _ctx.item.options.maxlength,
        rows: _ctx.item.options && _ctx.item.options.rows,
        "show-word-limit": _ctx.item.options && _ctx.item.options.showWordLimit || true,
        autosize: $setup.autosize
      }, null, 8, ["modelValue", "disabled", "readonly", "placeholder", "maxlength", "rows", "show-word-limit", "autosize"])) : (openBlock(), createElementBlock("div", _hoisted_1$f, toDisplayString(_ctx.fieldModel), 1))
    ]),
    _: 1
  }, 8, ["designer", "widget-list", "item", "rules", "index", "show-message"]));
}
const mTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$e]]);
const _sfc_main$e = {
  name: "MTime",
  props,
  emits: ["update:modelValue"],
  setup(props2, { emit }) {
    const showPicker = ref$1(false);
    const currentTime = computed(() => {
      if (props2.item.options.format) {
        if (props2.item.options.format.indexOf("ss") === -1) {
          return ["00", "00"];
        }
      }
      return ["00", "00", "00"];
    });
    const columnsType = computed(() => {
      if (props2.item.options.format) {
        if (props2.item.options.format.indexOf("ss") === -1) {
          return ["hour", "minute"];
        }
      }
      return ["hour", "minute", "second"];
    });
    const fieldModelText = computed(() => {
      if (props2.modelValue) {
        const times = props2.modelValue.split(":");
        const time = { hour: times[0], minute: times[1], seconds: times[2] };
        return moment(time).format(props2.item.options.format || "HH:mm:ss");
      }
      return "";
    });
    const onShowPicker = () => {
      const { isDetail } = init(props2, emit);
      if (!props2.item.options.readonly && !props2.item.options.disabled && !isDetail.value) {
        showPicker.value = true;
      }
    };
    const onConfirm = ({ selectedValues }) => {
      const time = { hour: selectedValues[0], minute: selectedValues[1], seconds: selectedValues[2] };
      emit("update:modelValue", moment(time).format("HH:mm:ss"));
      showPicker.value = false;
    };
    return {
      showPicker,
      currentTime,
      columnsType,
      fieldModelText,
      onShowPicker,
      onConfirm,
      ...init(props2, emit)
    };
  }
};
const _hoisted_1$e = { key: 1 };
function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
  var _a2;
  const _component_van_field = resolveComponent("van-field");
  const _component_el_time_picker = resolveComponent("el-time-picker");
  const _component_widget_form_item = resolveComponent("widget-form-item");
  const _component_van_time_picker = resolveComponent("van-time-picker");
  const _component_van_popup = resolveComponent("van-popup");
  return openBlock(), createElementBlock(Fragment, null, [
    _ctx.h5 ? (openBlock(), createBlock(_component_van_field, {
      key: 0,
      modelValue: $setup.fieldModelText,
      "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.fieldModelText = $event),
      "is-link": !_ctx.isDetail,
      readonly: "",
      name: _ctx.item.options && _ctx.item.options.name,
      label: _ctx.item.options && _ctx.item.options.label,
      disabled: _ctx.item.options && _ctx.item.options.disabled,
      placeholder: _ctx.isDetail ? "" : _ctx.item.options && _ctx.item.options.placeholder,
      clearable: _ctx.item.options && _ctx.item.options.clearable,
      required: _ctx.item.options && !_ctx.isDetail && _ctx.item.options.required,
      rules: _ctx.isDetail ? [] : _ctx.rules,
      border: false,
      "label-width": ((_a2 = _ctx.item.options) == null ? void 0 : _a2.labelPosition) === "top" ? "100%" : void 0,
      "label-align": _ctx.item.options && _ctx.item.options.labelPosition || void 0,
      "input-align": _ctx.item.options && _ctx.item.options.inputAlign || void 0,
      onClick: $setup.onShowPicker
    }, null, 8, ["modelValue", "is-link", "name", "label", "disabled", "placeholder", "clearable", "required", "rules", "label-width", "label-align", "input-align", "onClick"])) : (openBlock(), createBlock(_component_widget_form_item, {
      key: 1,
      designer: _ctx.designer,
      "widget-list": _ctx.widgetList,
      item: _ctx.item,
      rules: _ctx.isDetail ? [] : _ctx.rules,
      index: _ctx.index,
      "show-message": !_ctx.isDetail
    }, {
      default: withCtx(() => [
        !_ctx.isDetail ? (openBlock(), createBlock(_component_el_time_picker, {
          key: 0,
          modelValue: _ctx.fieldModel,
          "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.fieldModel = $event),
          style: normalizeStyle([{ "display": "inline-flex" }, { width: "100%" }]),
          disabled: _ctx.item.options && _ctx.item.options.disabled,
          readonly: _ctx.item.options && _ctx.item.options.readonly,
          placeholder: _ctx.item.options && _ctx.item.options.placeholder,
          clearable: _ctx.item.options && _ctx.item.options.clearable,
          format: _ctx.item.options && _ctx.item.options.format || "HH:mm:ss",
          "value-format": "HH:mm:ss",
          "default-value": new Date(2016, 1, 1, 0, 0),
          editable: false
        }, null, 8, ["modelValue", "disabled", "readonly", "placeholder", "clearable", "format", "default-value"])) : (openBlock(), createElementBlock("div", _hoisted_1$e, toDisplayString(_ctx.fieldModel), 1))
      ]),
      _: 1
    }, 8, ["designer", "widget-list", "item", "rules", "index", "show-message"])),
    createVNode(_component_van_popup, {
      show: $setup.showPicker,
      "onUpdate:show": _cache[3] || (_cache[3] = ($event) => $setup.showPicker = $event),
      round: "",
      position: "bottom"
    }, {
      default: withCtx(() => [
        createVNode(_component_van_time_picker, {
          "model-value": $setup.currentTime,
          title: _ctx.item.options.label,
          "columns-type": $setup.columnsType,
          onConfirm: $setup.onConfirm,
          onCancel: _cache[2] || (_cache[2] = ($event) => $setup.showPicker = false)
        }, null, 8, ["model-value", "title", "columns-type", "onConfirm"])
      ]),
      _: 1
    }, 8, ["show"])
  ], 64);
}
const mTime = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$d]]);
const mSignature_vue_vue_type_style_index_0_lang = "";
const _sfc_main$d = {
  name: "MSignature",
  props,
  emits: ["update:modelValue"],
  setup(props2, { emit }) {
    const { proxy } = getCurrentInstance();
    const show = ref$1(false);
    const showOverlay = ref$1(false);
    const onSubmit = ({ image }) => {
      show.value = false;
      emit("update:modelValue", image);
    };
    const onClick = () => {
      if (props2.h5) {
        show.value = !show.value;
        showOverlay.value = show.value;
      } else {
        proxy.$message.error("移动端支持签名！");
      }
    };
    return {
      show,
      showOverlay,
      onClick,
      onSubmit,
      ...init(props2, emit)
    };
  }
};
const _hoisted_1$d = {
  key: 0,
  class: "signature-image"
};
const _hoisted_2$b = {
  key: 0,
  class: "signature-image"
};
const _hoisted_3$9 = {
  key: 2,
  class: "signature-content"
};
function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
  var _a2;
  const _component_van_image = resolveComponent("van-image");
  const _component_van_icon = resolveComponent("van-icon");
  const _component_van_field = resolveComponent("van-field");
  const _component_el_image = resolveComponent("el-image");
  const _component_EditPen = resolveComponent("EditPen");
  const _component_el_icon = resolveComponent("el-icon");
  const _component_widget_form_item = resolveComponent("widget-form-item");
  const _component_van_signature = resolveComponent("van-signature");
  return openBlock(), createElementBlock(Fragment, null, [
    _ctx.h5 ? (openBlock(), createBlock(_component_van_field, {
      key: 0,
      modelValue: _ctx.fieldModel,
      "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.fieldModel = $event),
      name: _ctx.item.options && _ctx.item.options.name,
      label: _ctx.item.options && _ctx.item.options.label,
      disabled: _ctx.item.options && _ctx.item.options.disabled,
      required: _ctx.item.options && !_ctx.isDetail && _ctx.item.options.required,
      rules: _ctx.isDetail ? [] : _ctx.rules,
      border: false,
      "label-width": ((_a2 = _ctx.item.options) == null ? void 0 : _a2.labelPosition) === "top" ? "100%" : void 0,
      "label-align": _ctx.item.options && _ctx.item.options.labelPosition || void 0,
      "input-align": _ctx.item.options && _ctx.item.options.inputAlign || void 0
    }, {
      input: withCtx(() => [
        _ctx.fieldModel ? (openBlock(), createElementBlock("div", _hoisted_1$d, [
          createVNode(_component_van_image, {
            class: "image",
            src: _ctx.fieldModel
          }, null, 8, ["src"]),
          !_ctx.isDetail ? (openBlock(), createElementBlock("div", {
            key: 0,
            class: "signature-input",
            onClick: _cache[0] || (_cache[0] = (...args) => $setup.onClick && $setup.onClick(...args))
          }, [
            createVNode(_component_van_icon, {
              name: "edit",
              class: "icon"
            }),
            createElementVNode("span", null, toDisplayString(_ctx.item.options.reSignText || "重新签名"), 1)
          ])) : createCommentVNode("", true)
        ])) : !_ctx.isDetail ? (openBlock(), createElementBlock("div", {
          key: 1,
          class: "signature-input",
          onClick: _cache[1] || (_cache[1] = (...args) => $setup.onClick && $setup.onClick(...args))
        }, [
          createVNode(_component_van_icon, {
            name: "edit",
            class: "icon"
          }),
          createElementVNode("span", null, toDisplayString(_ctx.item.options.signText || "点击去签名"), 1)
        ])) : createCommentVNode("", true)
      ]),
      _: 1
    }, 8, ["modelValue", "name", "label", "disabled", "required", "rules", "label-width", "label-align", "input-align"])) : (openBlock(), createBlock(_component_widget_form_item, {
      key: 1,
      designer: _ctx.designer,
      "widget-list": _ctx.widgetList,
      item: _ctx.item,
      rules: _ctx.isDetail ? [] : _ctx.rules,
      index: _ctx.index,
      "show-message": !_ctx.isDetail
    }, {
      default: withCtx(() => [
        _ctx.fieldModel ? (openBlock(), createElementBlock("div", _hoisted_2$b, [
          createVNode(_component_el_image, {
            class: "image",
            src: _ctx.fieldModel
          }, null, 8, ["src"]),
          !_ctx.isDetail ? (openBlock(), createElementBlock("div", {
            key: 0,
            class: "signature-input",
            onClick: _cache[3] || (_cache[3] = (...args) => $setup.onClick && $setup.onClick(...args))
          }, [
            createVNode(_component_el_icon, { class: "icon" }, {
              default: withCtx(() => [
                createVNode(_component_EditPen)
              ]),
              _: 1
            }),
            createElementVNode("span", null, toDisplayString(_ctx.item.options.reSignText || "重新签名"), 1)
          ])) : createCommentVNode("", true)
        ])) : !_ctx.isDetail ? (openBlock(), createElementBlock("div", {
          key: 1,
          class: "signature-input",
          onClick: _cache[4] || (_cache[4] = (...args) => $setup.onClick && $setup.onClick(...args))
        }, [
          createVNode(_component_el_icon, { class: "icon" }, {
            default: withCtx(() => [
              createVNode(_component_EditPen)
            ]),
            _: 1
          }),
          createElementVNode("span", null, toDisplayString(_ctx.item.options.signText || "点击去签名"), 1)
        ])) : createCommentVNode("", true)
      ]),
      _: 1
    }, 8, ["designer", "widget-list", "item", "rules", "index", "show-message"])),
    $setup.show && !_ctx.isDetail ? (openBlock(), createElementBlock("div", _hoisted_3$9, [
      createVNode(_component_van_signature, {
        "line-width": _ctx.item.options.lineWidth,
        "background-color": _ctx.item.options.backgroundColor,
        "pen-color": _ctx.item.options.penColor,
        onSubmit: $setup.onSubmit
      }, null, 8, ["line-width", "background-color", "pen-color", "onSubmit"]),
      $setup.showOverlay ? (openBlock(), createElementBlock("div", {
        key: 0,
        class: "overlay",
        onClick: _cache[5] || (_cache[5] = ($event) => $setup.showOverlay = false)
      }, "请在此空白处签名")) : createCommentVNode("", true)
    ])) : createCommentVNode("", true)
  ], 64);
}
const mSignature = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$c]]);
const _sfc_main$c = {
  name: "MComputedays",
  props,
  emits: ["update:modelValue"],
  setup(props2, { emit }) {
    const append = computed(() => {
      if (props2.item.options.append) {
        return props2.item.options.append;
      }
      return "";
    });
    function calculateLeaveDuration(startDateTime, endDateTime, { workdayMode, holidays = [], workdays = [], workTime = [], returnHours = false }) {
      if (startDateTime > endDateTime)
        throw new Error("结束时间必须晚于开始时间");
      if (!workdayMode) {
        const diffHours = (endDateTime - startDateTime) / (1e3 * 60 * 60);
        if (returnHours)
          return diffHours;
        return roundToHalf(diffHours / 24);
      }
      let totalHours = 0;
      const current = new Date(startDateTime);
      current.setHours(0, 0, 0, 0);
      while (current <= endDateTime) {
        if (isWorkday(current, holidays, workdays)) {
          const dayStart = new Date(current);
          const dayEnd = new Date(current);
          dayEnd.setDate(dayEnd.getDate() + 1);
          const effectiveStart = startDateTime > dayStart ? startDateTime : dayStart;
          const effectiveEnd = endDateTime < dayEnd ? endDateTime : dayEnd;
          totalHours += calculateDailyHours(effectiveStart, effectiveEnd, workTime);
        }
        current.setDate(current.getDate() + 1);
      }
      if (returnHours)
        return totalHours;
      return roundToHalf(totalHours / 8);
    }
    function isWorkday(date, holidays, workdays) {
      const dateStr = date.toISOString().split("T")[0];
      if (holidays.includes(dateStr))
        return false;
      const dayOfWeek = date.getDay();
      const isWeekend = dayOfWeek === 0 || dayOfWeek === 6;
      return isWeekend ? workdays.includes(dateStr) : true;
    }
    function calculateDailyHours(start, end, workTime) {
      let totalMs = 0;
      const startMs = start.getTime();
      const endMs = end.getTime();
      workTime.forEach(({ start: s, end: e }) => {
        const [sHour, sMin] = s.split(":").map(Number);
        const [eHour, eMin] = e.split(":").map(Number);
        const workStart = new Date(start);
        workStart.setHours(sHour, sMin, 0, 0);
        const workEnd = new Date(start);
        workEnd.setHours(eHour, eMin, 0, 0);
        const overlapStart = Math.max(startMs, workStart.getTime());
        const overlapEnd = Math.min(endMs, workEnd.getTime());
        if (overlapStart < overlapEnd)
          totalMs += overlapEnd - overlapStart;
      });
      return totalMs / (1e3 * 60 * 60);
    }
    function roundToHalf(num) {
      return Math.round(num * 2) / 2;
    }
    watch(
      () => props2.formData,
      (data) => {
        const { selectStart, selectEnd, workdayMode, holidays, workdays, workTime, append: append2 } = props2.item.options;
        const returnHours = append2 === "小时";
        if (selectStart && selectEnd) {
          if (data[selectStart] && data[selectEnd]) {
            const start = new Date(data[selectStart].replace(/\s/, "T"));
            const end = new Date(data[selectEnd].replace(/\s/, "T"));
            if (start < end) {
              const value = calculateLeaveDuration(start, end, {
                workdayMode,
                holidays,
                workdays,
                workTime,
                returnHours
              });
              emit("update:modelValue", String(value));
            } else {
              emit("update:modelValue", "0");
            }
          }
        }
      },
      { deep: true }
    );
    return {
      append,
      ...init(props2, emit)
    };
  }
};
const _hoisted_1$c = { key: 1 };
const _hoisted_2$a = {
  key: 0,
  style: { "padding-left": "8px" }
};
function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
  var _a2;
  const _component_van_field = resolveComponent("van-field");
  const _component_el_input = resolveComponent("el-input");
  const _component_widget_form_item = resolveComponent("widget-form-item");
  return _ctx.h5 ? withDirectives((openBlock(), createBlock(_component_van_field, {
    key: 0,
    modelValue: _ctx.fieldModel,
    "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.fieldModel = $event),
    type: "text",
    name: _ctx.item.options && _ctx.item.options.name,
    label: _ctx.item.options && _ctx.item.options.label,
    readonly: true,
    placeholder: _ctx.isDetail ? "" : _ctx.item.options && _ctx.item.options.placeholder,
    border: false,
    "label-width": ((_a2 = _ctx.item.options) == null ? void 0 : _a2.labelPosition) === "top" ? "100%" : void 0,
    "label-align": _ctx.item.options && _ctx.item.options.labelPosition || void 0,
    "input-align": _ctx.item.options && _ctx.item.options.inputAlign || void 0,
    autocomplete: "off"
  }, createSlots({ _: 2 }, [
    $setup.append ? {
      name: "button",
      fn: withCtx(() => [
        createTextVNode(toDisplayString($setup.append), 1)
      ]),
      key: "0"
    } : void 0
  ]), 1032, ["modelValue", "name", "label", "placeholder", "label-width", "label-align", "input-align"])), [
    [vShow, _ctx.designer || _ctx.item.options && !_ctx.item.options.hidden]
  ]) : withDirectives((openBlock(), createBlock(_component_widget_form_item, {
    key: 1,
    designer: _ctx.designer,
    "widget-list": _ctx.widgetList,
    item: _ctx.item,
    index: _ctx.index,
    "show-message": !_ctx.isDetail
  }, {
    default: withCtx(() => [
      !_ctx.isDetail ? (openBlock(), createBlock(_component_el_input, {
        key: _ctx.item.options.type,
        modelValue: _ctx.fieldModel,
        "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.fieldModel = $event),
        type: "text",
        readonly: true,
        placeholder: _ctx.item.options && _ctx.item.options.placeholder,
        min: _ctx.item.options && _ctx.item.options.min,
        max: _ctx.item.options && _ctx.item.options.max
      }, createSlots({ _: 2 }, [
        $setup.append ? {
          name: "append",
          fn: withCtx(() => [
            createTextVNode(toDisplayString($setup.append), 1)
          ]),
          key: "0"
        } : void 0
      ]), 1032, ["modelValue", "placeholder", "min", "max"])) : (openBlock(), createElementBlock("div", _hoisted_1$c, [
        createTextVNode(toDisplayString(_ctx.fieldModel) + " ", 1),
        $setup.append ? (openBlock(), createElementBlock("span", _hoisted_2$a, toDisplayString($setup.append), 1)) : createCommentVNode("", true)
      ]))
    ]),
    _: 1
  }, 8, ["designer", "widget-list", "item", "index", "show-message"])), [
    [vShow, _ctx.designer || _ctx.item.options && !_ctx.item.options.hidden]
  ]);
}
const mComputedays = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$b]]);
const _sfc_main$b = {
  name: "MUpperamount",
  props,
  emits: ["update:modelValue"],
  setup(props2, { emit }) {
    let timeout;
    watch(
      () => props2.formData,
      (data) => {
        const { selectSumName } = props2.item.options;
        if (selectSumName) {
          clearTimeout(timeout);
          timeout = setTimeout(() => {
            if (data[selectSumName]) {
              const num = amountToChinese(data[selectSumName]);
              emit("update:modelValue", num);
            } else {
              emit("update:modelValue", "");
            }
          }, 50);
        }
      },
      { deep: true }
    );
    function amountToChinese(amount) {
      const cnNums = ["零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"];
      const cnIntRadice = ["", "拾", "佰", "仟"];
      const cnIntUnits = ["", "万", "亿", "兆"];
      const cnDecUnits = ["角", "分"];
      const cnInteger = "整";
      const cnIntLast = "元";
      const maxNum = props2.item.options.max || 1e15;
      let integerNum;
      let decimalNum;
      let chineseStr = "";
      let parts;
      if (typeof amount !== "string") {
        amount = amount.toString();
      }
      if (amount === "") {
        return "";
      }
      let isNegative = false;
      if (amount.startsWith("-")) {
        isNegative = true;
        amount = amount.slice(1);
      }
      if (amount.indexOf(".") === -1) {
        integerNum = amount;
        decimalNum = "";
      } else {
        parts = amount.split(".");
        integerNum = parts[0];
        decimalNum = parts[1].substr(0, 2);
      }
      if (integerNum > maxNum) {
        return "";
      }
      if (parseInt(integerNum, 10) > 0) {
        let zeroCount = 0;
        const IntLen = integerNum.length;
        for (let i = 0; i < IntLen; i++) {
          const n = integerNum.substr(i, 1);
          const p = IntLen - i - 1;
          const q = Math.floor(p / 4);
          const m = p % 4;
          if (n === "0") {
            zeroCount++;
          } else {
            if (zeroCount > 0) {
              chineseStr += cnNums[0];
            }
            zeroCount = 0;
            chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
          }
          if (m === 0 && zeroCount < 4) {
            chineseStr += cnIntUnits[q];
          }
        }
        chineseStr += cnIntLast;
      }
      if (decimalNum !== "") {
        const decLen = decimalNum.length;
        for (let i = 0; i < decLen; i++) {
          const n = decimalNum.substr(i, 1);
          if (n !== "0") {
            chineseStr += cnNums[Number(n)] + cnDecUnits[i];
          }
        }
      }
      if (chineseStr === "") {
        chineseStr += cnNums[0] + cnIntLast + cnInteger;
      } else if (decimalNum === "") {
        chineseStr += cnInteger;
      }
      if (isNegative) {
        chineseStr = "负" + chineseStr;
      }
      return chineseStr;
    }
    return {
      ...init(props2, emit)
    };
  }
};
const _hoisted_1$b = { key: 1 };
function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
  var _a2;
  const _component_van_field = resolveComponent("van-field");
  const _component_el_input = resolveComponent("el-input");
  const _component_widget_form_item = resolveComponent("widget-form-item");
  return _ctx.h5 ? withDirectives((openBlock(), createBlock(_component_van_field, {
    key: 0,
    modelValue: _ctx.fieldModel,
    "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.fieldModel = $event),
    type: "text",
    name: _ctx.item.options && _ctx.item.options.name,
    label: _ctx.item.options && _ctx.item.options.label,
    readonly: _ctx.isDetail || _ctx.designer || _ctx.item.options && _ctx.item.options.readonly,
    placeholder: _ctx.isDetail ? "" : _ctx.item.options && _ctx.item.options.placeholder,
    maxlength: _ctx.item.options && _ctx.item.options.maxlength || void 0,
    required: _ctx.item.options && !_ctx.isDetail && _ctx.item.options.required,
    rules: _ctx.isDetail ? [] : _ctx.rules,
    border: false,
    "label-width": ((_a2 = _ctx.item.options) == null ? void 0 : _a2.labelPosition) === "top" ? "100%" : void 0,
    "label-align": _ctx.item.options && _ctx.item.options.labelPosition || void 0,
    "input-align": _ctx.item.options && _ctx.item.options.inputAlign || void 0,
    autocomplete: "off"
  }, null, 8, ["modelValue", "name", "label", "readonly", "placeholder", "maxlength", "required", "rules", "label-width", "label-align", "input-align"])), [
    [vShow, _ctx.designer || _ctx.item.options && !_ctx.item.options.hidden]
  ]) : withDirectives((openBlock(), createBlock(_component_widget_form_item, {
    key: 1,
    designer: _ctx.designer,
    "widget-list": _ctx.widgetList,
    item: _ctx.item,
    rules: _ctx.isDetail ? [] : _ctx.rules,
    index: _ctx.index,
    "show-message": !_ctx.isDetail
  }, {
    default: withCtx(() => [
      !_ctx.isDetail ? (openBlock(), createBlock(_component_el_input, {
        key: 0,
        modelValue: _ctx.fieldModel,
        "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.fieldModel = $event),
        readonly: _ctx.designer || _ctx.item.options && _ctx.item.options.readonly,
        placeholder: _ctx.item.options && _ctx.item.options.placeholder,
        maxlength: _ctx.item.options && _ctx.item.options.maxlength
      }, null, 8, ["modelValue", "readonly", "placeholder", "maxlength"])) : (openBlock(), createElementBlock("div", _hoisted_1$b, toDisplayString(_ctx.fieldModel), 1))
    ]),
    _: 1
  }, 8, ["designer", "widget-list", "item", "rules", "index", "show-message"])), [
    [vShow, _ctx.designer || _ctx.item.options && !_ctx.item.options.hidden]
  ]);
}
const mUpperamount = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$a]]);
const _sfc_main$a = {
  name: "MPhone",
  props,
  emits: ["update:modelValue"],
  setup(props2, { emit }) {
    const fieldModel = computed({
      get() {
        return props2.modelValue;
      },
      set(val) {
        if (!props2.designer) {
          emit("update:modelValue", val);
        }
      }
    });
    const isDetail = computed(() => {
      if (props2.detail) {
        return true;
      }
      return props2.item.permission > 0;
    });
    const validatePhone = (rule, value, callback) => {
      if (!value) {
        callback();
      } else if (!/^1[3456789]\d{9}$/.test(value)) {
        callback(new Error(props2.item.options.pattern || ""));
      } else {
        callback();
      }
    };
    const validatePhoneH5 = (value) => {
      if (!/^1[3456789]\d{9}$/.test(value)) {
        return props2.item.options.pattern || "";
      }
      return true;
    };
    const rules = reactive([
      {
        required: !props2.item.options.hidden && !props2.item.options.readonly && props2.item.options.required,
        message: props2.h5 ? "" : props2.item.options.requiredMessage,
        trigger: "change"
      },
      {
        validator: props2.h5 ? validatePhoneH5 : validatePhone,
        trigger: "blur",
        validateEmpty: false
        // vant 对空值进行校验
      }
    ]);
    const formatter = (value) => value.replace(/\D/g, "");
    const handleInput = (value) => {
      let filtered = value.replace(/\D/g, "");
      if (filtered !== value) {
        emit("update:modelValue", filtered);
      }
    };
    return {
      fieldModel,
      isDetail,
      rules,
      formatter,
      handleInput
    };
  }
};
const _hoisted_1$a = { key: 1 };
function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
  var _a2;
  const _component_van_field = resolveComponent("van-field");
  const _component_el_input = resolveComponent("el-input");
  const _component_widget_form_item = resolveComponent("widget-form-item");
  return _ctx.h5 ? withDirectives((openBlock(), createBlock(_component_van_field, {
    key: 0,
    modelValue: $setup.fieldModel,
    "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.fieldModel = $event),
    type: "tel",
    maxlength: "11",
    formatter: $setup.formatter,
    name: _ctx.item.options && _ctx.item.options.name,
    label: _ctx.item.options && _ctx.item.options.label,
    readonly: $setup.isDetail || _ctx.designer || _ctx.item.options && _ctx.item.options.readonly,
    placeholder: $setup.isDetail ? "" : _ctx.item.options && _ctx.item.options.placeholder,
    required: _ctx.item.options && !$setup.isDetail && _ctx.item.options.required,
    rules: $setup.isDetail ? [] : $setup.rules,
    border: false,
    "label-width": ((_a2 = _ctx.item.options) == null ? void 0 : _a2.labelPosition) === "top" ? "100%" : void 0,
    "label-align": _ctx.item.options && _ctx.item.options.labelPosition || void 0,
    "input-align": _ctx.item.options && _ctx.item.options.inputAlign || void 0,
    autocomplete: "off"
  }, null, 8, ["modelValue", "formatter", "name", "label", "readonly", "placeholder", "required", "rules", "label-width", "label-align", "input-align"])), [
    [vShow, _ctx.designer || _ctx.item.options && !_ctx.item.options.hidden]
  ]) : withDirectives((openBlock(), createBlock(_component_widget_form_item, {
    key: 1,
    designer: _ctx.designer,
    "widget-list": _ctx.widgetList,
    item: _ctx.item,
    rules: $setup.isDetail ? [] : $setup.rules,
    index: _ctx.index,
    "show-message": !$setup.isDetail
  }, {
    default: withCtx(() => [
      !$setup.isDetail ? (openBlock(), createBlock(_component_el_input, {
        key: 0,
        modelValue: $setup.fieldModel,
        "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.fieldModel = $event),
        type: "text",
        maxlength: "11",
        readonly: _ctx.designer || _ctx.item.options && _ctx.item.options.readonly,
        placeholder: _ctx.item.options && _ctx.item.options.placeholder,
        onInput: $setup.handleInput
      }, null, 8, ["modelValue", "readonly", "placeholder", "onInput"])) : (openBlock(), createElementBlock("div", _hoisted_1$a, toDisplayString($setup.fieldModel), 1))
    ]),
    _: 1
  }, 8, ["designer", "widget-list", "item", "rules", "index", "show-message"])), [
    [vShow, _ctx.designer || _ctx.item.options && !_ctx.item.options.hidden]
  ]);
}
const mPhone = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$9]]);
const mSubform_vue_vue_type_style_index_0_scoped_c795e7d8_lang = "";
const _sfc_main$9 = {
  name: "MSubform",
  components: { draggable },
  props,
  emits: ["update:modelValue"],
  setup(props2, { emit }) {
    const drag = reactive({
      dragging: false,
      componentData: {
        tag: "div",
        type: "transition-group"
      },
      dragOptions: {
        animation: 300,
        group: "people",
        ghostClass: "ghost",
        disabled: false,
        handle: ".drag-handler"
      }
    });
    const { dragging, componentData, dragOptions } = toRefs(drag);
    const fieldModel = computed({
      get() {
        return props2.modelValue || [{}];
      },
      set(val) {
        if (!props2.designer) {
          emit("update:modelValue", val);
        }
      }
    });
    const getCell = (item) => {
      const copyItem = JSON.parse(JSON.stringify(item));
      copyItem.options.label = "";
      return copyItem;
    };
    return {
      fieldModel,
      dragging,
      componentData,
      dragOptions,
      getCell
    };
  }
};
const _hoisted_1$9 = { key: 0 };
const _hoisted_2$9 = { class: "ep-subform-table" };
const _hoisted_3$8 = { class: "ep-subform-table-cell header" };
const _hoisted_4$5 = { class: "cell" };
const _hoisted_5$3 = { class: "cell" };
function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_el_scrollbar = resolveComponent("el-scrollbar");
  const _component_widget_form_item = resolveComponent("widget-form-item");
  return _ctx.h5 ? (openBlock(), createElementBlock("div", _hoisted_1$9, "1")) : (openBlock(), createBlock(_component_widget_form_item, {
    key: 1,
    designer: _ctx.designer,
    "widget-list": _ctx.widgetList,
    item: _ctx.item,
    index: _ctx.index
  }, {
    default: withCtx(() => [
      createVNode(_component_el_scrollbar, null, {
        default: withCtx(() => [
          createElementVNode("div", _hoisted_2$9, [
            (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.item.options.formItems, (cell, i) => {
              return openBlock(), createElementBlock("div", {
                key: i,
                class: "ep-subform-table-box",
                style: { "width": "180px" }
              }, [
                createElementVNode("div", _hoisted_3$8, [
                  createElementVNode("div", _hoisted_4$5, toDisplayString(cell.options.label), 1)
                ]),
                (openBlock(true), createElementBlock(Fragment, null, renderList($setup.fieldModel, (value, k) => {
                  return openBlock(), createElementBlock("div", {
                    key: k,
                    class: "ep-subform-table-cell"
                  }, [
                    createElementVNode("div", _hoisted_5$3, [
                      (openBlock(), createBlock(resolveDynamicComponent(`m-${cell.type}`), {
                        modelValue: value[cell.options.name],
                        "onUpdate:modelValue": ($event) => value[cell.options.name] = $event,
                        "form-data": value,
                        "widget-list": _ctx.item.options.formItems,
                        item: $setup.getCell(cell),
                        index: k,
                        detail: false
                      }, null, 8, ["modelValue", "onUpdate:modelValue", "form-data", "widget-list", "item", "index"]))
                    ])
                  ]);
                }), 128))
              ]);
            }), 128))
          ])
        ]),
        _: 1
      })
    ]),
    _: 1
  }, 8, ["designer", "widget-list", "item", "index"]));
}
const mSubform = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$8], ["__scopeId", "data-v-c795e7d8"]]);
const fields = {
  mAmount,
  mCard,
  mCascader,
  mCheckbox,
  mCheckboxlist,
  mCorrelation,
  mDate,
  mFileupload,
  mPicture,
  mInput,
  mNumber,
  mRadio,
  mSelect,
  mDivider,
  mTextarea,
  mTime,
  mSignature,
  mComputedays,
  mUpperamount,
  mPhone,
  mSubform
};
const index_vue_vue_type_style_index_0_lang$5 = "";
const _sfc_main$8 = {
  components: { draggable, ...fields },
  props: {
    /** 平台类型 PC/Pad/H5 */
    layoutType: {
      type: String,
      required: true
    },
    /** 容器滚动条高度 */
    height: {
      type: Number,
      default: 0
    },
    /** 组件列表 */
    widgetList: {
      type: Array,
      default: null
    },
    /** 表单配置 */
    formConfig: {
      type: Object,
      default: null
    }
  },
  setup(props2) {
    const panelHeight = computed(() => {
      return props2.height + "px";
    });
    const cardStyle = computed(() => {
      if (props2.layoutType === "Pad") {
        return { maxWidth: "820px", borderRadius: "20px" };
      }
      if (props2.layoutType === "H5") {
        return { maxWidth: "390px", borderRadius: "20px" };
      }
      return {};
    });
    const labelWidth = computed(() => {
      var _a2;
      return props2.formConfig && ((_a2 = props2.formConfig.pc) == null ? void 0 : _a2.labelWidth) || 100;
    });
    const size = computed(() => {
      var _a2;
      return props2.formConfig && ((_a2 = props2.formConfig.pc) == null ? void 0 : _a2.size) || "default";
    });
    const labelPosition = computed(() => {
      var _a2;
      return props2.formConfig && ((_a2 = props2.formConfig.pc) == null ? void 0 : _a2.labelPosition) || "left";
    });
    const drag = reactive({
      dragging: false,
      componentData: {
        tag: "div",
        type: "transition-group"
      },
      dragOptions: {
        animation: 300,
        group: "people",
        ghostClass: "ghost",
        disabled: false,
        handle: ".drag-handler"
      }
    });
    const formModel = ref$1({});
    const setSelected = inject("setSelected", null);
    const onDragAdd = (evt, widgetList) => {
      const newIndex = evt.newIndex;
      if (widgetList[newIndex]) {
        setSelected(widgetList[newIndex]);
      }
    };
    const checkMove = () => {
      return true;
    };
    const onDragUpdate = () => {
      console.log("onDragUpdate");
    };
    return {
      panelHeight,
      cardStyle,
      labelWidth,
      labelPosition,
      size,
      ...toRefs(drag),
      formModel,
      checkMove,
      onDragAdd,
      onDragUpdate
    };
  }
};
const _hoisted_1$8 = { class: "ep-widget-form-container" };
const _hoisted_2$8 = {
  key: 0,
  style: { "width": "100%" }
};
const _hoisted_3$7 = { style: { "width": "100%" } };
const _hoisted_4$4 = {
  key: 1,
  style: { "width": "100%" }
};
const _hoisted_5$2 = {
  key: 0,
  class: "form-empty"
};
function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_draggable = resolveComponent("draggable");
  const _component_el_form = resolveComponent("el-form");
  const _component_el_scrollbar = resolveComponent("el-scrollbar");
  const _component_el_card = resolveComponent("el-card");
  return openBlock(), createElementBlock("div", _hoisted_1$8, [
    createVNode(_component_el_card, {
      shadow: "never",
      style: normalizeStyle($setup.cardStyle)
    }, {
      default: withCtx(() => [
        createVNode(_component_el_scrollbar, {
          style: normalizeStyle({ height: $setup.panelHeight })
        }, {
          default: withCtx(() => [
            createVNode(_component_el_form, {
              model: $setup.formModel,
              style: normalizeStyle({ height: $setup.panelHeight }),
              "validate-on-rule-change": false,
              "hide-required-asterisk": false,
              "label-position": $setup.labelPosition,
              "label-width": $setup.labelWidth,
              size: $setup.size
            }, {
              default: withCtx(() => [
                createVNode(_component_draggable, mergeProps({
                  class: "form-widget-list flex",
                  tag: "transition-group",
                  "item-key": "id"
                }, _ctx.dragOptions, {
                  "component-data": _ctx.componentData,
                  list: $props.widgetList,
                  move: $setup.checkMove,
                  onStart: _cache[2] || (_cache[2] = ($event) => _ctx.dragging = true),
                  onEnd: _cache[3] || (_cache[3] = ($event) => _ctx.dragging = false),
                  onAdd: _cache[4] || (_cache[4] = (evt) => $setup.onDragAdd(evt, $props.widgetList)),
                  onUpdate: $setup.onDragUpdate
                }), {
                  item: withCtx(({ element: widget, index }) => [
                    widget.type === "card" ? (openBlock(), createElementBlock("div", _hoisted_2$8, [
                      (openBlock(), createBlock(resolveDynamicComponent(`m-${widget.type}`), {
                        modelValue: $setup.formModel[widget.options.name],
                        "onUpdate:modelValue": ($event) => $setup.formModel[widget.options.name] = $event,
                        "form-data": $setup.formModel,
                        "widget-list": $props.widgetList,
                        item: widget,
                        index,
                        designer: true
                      }, {
                        default: withCtx(({ components: components2 }) => [
                          createVNode(_component_draggable, mergeProps({
                            class: "form-widget-list flex",
                            tag: "transition-group",
                            "item-key": "id"
                          }, _ctx.dragOptions, {
                            "component-data": _ctx.componentData,
                            list: components2,
                            move: $setup.checkMove,
                            onStart: _cache[0] || (_cache[0] = ($event) => _ctx.dragging = true),
                            onEnd: _cache[1] || (_cache[1] = ($event) => _ctx.dragging = false),
                            onAdd: (evt) => $setup.onDragAdd(evt, components2),
                            onUpdate: $setup.onDragUpdate
                          }), {
                            item: withCtx(({ element: colWidget, index: colIndex }) => [
                              createElementVNode("div", _hoisted_3$7, [
                                (openBlock(), createBlock(resolveDynamicComponent(`m-${colWidget.type}`), {
                                  modelValue: $setup.formModel[colWidget.options.name],
                                  "onUpdate:modelValue": ($event) => $setup.formModel[colWidget.options.name] = $event,
                                  "form-data": $setup.formModel,
                                  "widget-list": components2,
                                  item: colWidget,
                                  index: colIndex,
                                  designer: true
                                }, null, 8, ["modelValue", "onUpdate:modelValue", "form-data", "widget-list", "item", "index"]))
                              ])
                            ]),
                            _: 2
                          }, 1040, ["component-data", "list", "move", "onAdd", "onUpdate"])
                        ]),
                        _: 2
                      }, 1032, ["modelValue", "onUpdate:modelValue", "form-data", "widget-list", "item", "index"]))
                    ])) : (openBlock(), createElementBlock("div", _hoisted_4$4, [
                      (openBlock(), createBlock(resolveDynamicComponent(`m-${widget.type}`), {
                        modelValue: $setup.formModel[widget.options.name],
                        "onUpdate:modelValue": ($event) => $setup.formModel[widget.options.name] = $event,
                        "form-data": $setup.formModel,
                        "widget-list": $props.widgetList,
                        item: widget,
                        index,
                        designer: true
                      }, null, 8, ["modelValue", "onUpdate:modelValue", "form-data", "widget-list", "item", "index"]))
                    ]))
                  ]),
                  _: 1
                }, 16, ["component-data", "list", "move", "onUpdate"])
              ]),
              _: 1
            }, 8, ["model", "style", "label-position", "label-width", "size"]),
            $props.widgetList.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_5$2, "从左侧拖拽或点击来添加字段")) : createCommentVNode("", true)
          ]),
          _: 1
        }, 8, ["style"])
      ]),
      _: 1
    }, 8, ["style"])
  ]);
}
const WidgetForm = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$7]]);
const index_vue_vue_type_style_index_0_lang$4 = "";
const _sfc_main$7 = {
  props: {
    /** 设计器中展示 */
    designer: {
      type: Boolean,
      default: false
    },
    /** 组件列表 */
    widgetList: {
      type: Array,
      default: () => []
    },
    /** 组件配置项 */
    item: {
      type: Object,
      default: () => {
      }
    },
    /** 表单验证规则 */
    rules: {
      type: Array,
      default: null
    },
    /** 组件索引 */
    index: {
      type: Number,
      default: 0
    },
    /** 是否显示校验错误信息 */
    showMessage: {
      type: Boolean,
      default: true
    }
  },
  setup(props2) {
    const { proxy } = getCurrentInstance();
    const selected = inject("selected", null);
    const designerSelected = computed(() => {
      if (props2.designer && selected.value.id === props2.item.id) {
        return true;
      }
      return false;
    });
    const setSelected = inject("setSelected", null);
    const usedConditionIds = inject("usedConditionIds", null);
    const usedConditionIdsList = computed(() => {
      return usedConditionIds.value || [];
    });
    const cardNotRemoveItems = ["Type", "BTime", "ETime", "leaveDays", "remark"];
    const removeDisabled = computed(() => {
      if (cardNotRemoveItems.includes(props2.item.options.name)) {
        return true;
      }
      return false;
    });
    const list = computed(() => props2.widgetList);
    const moveup = () => {
      if (Array.isArray(list.value)) {
        if (props2.index === 0) {
          proxy.$message.warning("已经移动到最上面.");
          return false;
        }
        list.value.splice(props2.index, 1, ...list.value.splice(props2.index - 1, 1, list.value[props2.index]));
      }
    };
    const movedown = () => {
      if (Array.isArray(list.value)) {
        if (props2.index === list.value.length - 1) {
          proxy.$message.warning("已经移动到最下面.");
          return false;
        }
        list.value.splice(props2.index, 1, ...list.value.splice(props2.index + 1, 1, list.value[props2.index]));
      }
    };
    const remove = () => {
      if (usedConditionIdsList.value.includes(props2.item.id)) {
        proxy.$message.error("该组件已作为流程判断条件，无法删除.");
        return false;
      }
      if (props2.item.type === "card") {
        if (props2.item.components.some((m) => usedConditionIdsList.value.includes(m.id))) {
          proxy.$message.error("该组件已作为流程判断条件，无法删除.");
          return false;
        }
      }
      list.value.splice(props2.index, 1);
      setSelected(list.value[list.value.length - 1] || {});
    };
    return {
      designerSelected,
      setSelected,
      remove,
      moveup,
      movedown,
      removeDisabled
    };
  }
};
const _hoisted_1$7 = { class: "ep-widget-form-item-container" };
const _hoisted_2$7 = {
  key: 3,
  class: "drag-handler"
};
const _hoisted_3$6 = {
  key: 4,
  class: "drag-action"
};
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_el_form_item = resolveComponent("el-form-item");
  const _component_Rank = resolveComponent("Rank");
  const _component_el_icon = resolveComponent("el-icon");
  const _component_el_button = resolveComponent("el-button");
  const _component_el_button_group = resolveComponent("el-button-group");
  return openBlock(), createElementBlock("div", _hoisted_1$7, [
    $props.item.type === "card" ? (openBlock(), createElementBlock("div", {
      key: 0,
      class: normalizeClass([{ selected: $setup.designerSelected, card: $props.designer }, "form-item"]),
      onClick: _cache[0] || (_cache[0] = ($event) => $props.designer && $setup.setSelected && $setup.setSelected($props.item))
    }, [
      renderSlot(_ctx.$slots, "default")
    ], 2)) : $props.item.type === "divider" ? (openBlock(), createElementBlock("div", {
      key: 1,
      class: normalizeClass([{ selected: $setup.designerSelected }, "form-divider"]),
      onClick: _cache[1] || (_cache[1] = ($event) => $props.designer && $setup.setSelected && $setup.setSelected($props.item))
    }, [
      renderSlot(_ctx.$slots, "default")
    ], 2)) : (openBlock(), createElementBlock("div", {
      key: 2,
      onClick: _cache[2] || (_cache[2] = withModifiers(($event) => $props.designer && $setup.setSelected && $setup.setSelected($props.item), ["stop"]))
    }, [
      createVNode(_component_el_form_item, {
        label: $props.item.options.label,
        rules: $props.rules,
        prop: $props.item.options.name,
        "label-position": $props.item.options && $props.item.options.labelPosition || void 0,
        "show-message": $props.showMessage,
        class: normalizeClass({ selected: $setup.designerSelected, "deep-select": $props.designer && $props.item.type !== "subform" })
      }, {
        default: withCtx(() => [
          renderSlot(_ctx.$slots, "default")
        ]),
        _: 3
      }, 8, ["label", "rules", "prop", "label-position", "show-message", "class"])
    ])),
    $setup.designerSelected && !$setup.removeDisabled ? (openBlock(), createElementBlock("div", _hoisted_2$7, [
      createVNode(_component_el_icon, null, {
        default: withCtx(() => [
          createVNode(_component_Rank)
        ]),
        _: 1
      })
    ])) : createCommentVNode("", true),
    $setup.designerSelected ? (openBlock(), createElementBlock("div", _hoisted_3$6, [
      createVNode(_component_el_button_group, null, {
        default: withCtx(() => [
          createVNode(_component_el_button, {
            disabled: $props.index == 0,
            type: "primary",
            icon: "Top",
            size: "small",
            onClick: withModifiers($setup.moveup, ["stop"])
          }, null, 8, ["disabled", "onClick"]),
          createVNode(_component_el_button, {
            disabled: $props.index == $props.widgetList.length - 1,
            type: "primary",
            icon: "Bottom",
            size: "small",
            onClick: withModifiers($setup.movedown, ["stop"])
          }, null, 8, ["disabled", "onClick"]),
          createVNode(_component_el_button, {
            disabled: $setup.removeDisabled,
            type: "primary",
            icon: "Delete",
            size: "small",
            onClick: withModifiers($setup.remove, ["stop"])
          }, null, 8, ["disabled", "onClick"])
        ]),
        _: 1
      })
    ])) : createCommentVNode("", true)
  ]);
}
const WidgetFormItem = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$6]]);
const basicFields = [
  {
    type: "input",
    name: "文本输入",
    icon: "input-text",
    options: {
      name: "",
      label: "",
      defaultValueType: 0,
      // 0自定义 1公式编辑
      defaultValue: "",
      defaultValueFunc: "",
      // 公式表达式
      maxlength: "20",
      showWordLimit: false,
      placeholder: "可以填写任意文本",
      append: "",
      disabled: false,
      readonly: false,
      clearable: false,
      workflow: true,
      // 加入审批流程条件使用
      required: false,
      requiredMessage: "不能为空！"
    }
  },
  {
    type: "textarea",
    name: "多行输入",
    icon: "input-textarea",
    options: {
      name: "",
      label: "",
      defaultValue: "",
      maxlength: "3000",
      rows: 3,
      autosize: true,
      showWordLimit: true,
      ellipsis: 3,
      // 详情展示的行数
      expandTips: "展开",
      retractTips: "收起",
      placeholder: "可以填写任意文本",
      disabled: false,
      readonly: false,
      workflow: false,
      required: false,
      requiredMessage: "不能为空！"
    }
  },
  {
    type: "number",
    name: "数字输入",
    icon: "input-number",
    options: {
      name: "",
      label: "",
      defaultValue: 0,
      min: 0,
      max: 9999,
      placeholder: "只能填写数字",
      append: "",
      disabled: false,
      readonly: false,
      workflow: true,
      required: false,
      requiredMessage: "不能为空！"
    }
  },
  {
    type: "radio",
    name: "单项选择",
    icon: "input-radio",
    options: {
      name: "",
      label: "",
      defaultValue: "1",
      optionItems: [
        { label: "选项一", value: "1" },
        { label: "选项二", value: "2" },
        { label: "选项三", value: "3" }
      ],
      inline: true,
      // 是否显示为一行
      disabled: false,
      workflow: true,
      required: false,
      requiredMessage: "不能为空！"
    }
  },
  {
    type: "checkbox",
    name: "多项选择",
    icon: "input-checkbox",
    options: {
      name: "",
      label: "",
      defaultValue: [],
      optionItems: [
        { label: "选项一", value: "1" },
        { label: "选项二", value: "2" },
        { label: "选项三", value: "3" }
      ],
      inline: true,
      // 是否显示为一行
      disabled: false,
      workflow: true,
      required: false,
      requiredMessage: "不能为空！"
    }
  },
  {
    type: "select",
    name: "选择列表",
    icon: "input-select",
    options: {
      name: "",
      label: "",
      defaultValue: "1",
      optionItems: [
        { label: "选项一", value: "1" },
        { label: "选项二", value: "2" },
        { label: "选项三", value: "3" }
      ],
      placeholder: "请选择",
      disabled: false,
      clearable: false,
      workflow: true,
      required: false,
      requiredMessage: "不能为空！"
    }
  },
  {
    type: "checkboxlist",
    name: "下拉复选框",
    icon: "input-checkboxlist",
    options: {
      name: "",
      label: "",
      defaultValue: [],
      optionItems: [
        { label: "选项一", value: "1" },
        { label: "选项二", value: "2" },
        { label: "选项三", value: "3" }
      ],
      placeholder: "请选择",
      collapseTags: true,
      // 多选时折叠标签
      maxCollapseTags: 3,
      // 最多显示多少个标签
      ellipsis: false,
      // 显示省略号
      disabled: false,
      clearable: false,
      workflow: true,
      required: false,
      requiredMessage: "不能为空！"
    }
  },
  {
    type: "time",
    name: "时间选择",
    icon: "input-time",
    options: {
      name: "",
      label: "",
      defaultValue: "",
      format: "",
      // 时间格式
      placeholder: "请选择",
      disabled: false,
      readonly: false,
      clearable: false,
      required: false,
      requiredMessage: "不能为空！"
    }
  },
  {
    type: "date",
    name: "日期选择",
    icon: "input-date",
    options: {
      name: "",
      label: "",
      defaultValue: "",
      type: "date",
      format: "YYYY-MM-DD",
      placeholder: "请选择",
      disabled: false,
      readonly: false,
      clearable: false,
      required: false,
      requiredMessage: "不能为空！"
    }
  },
  {
    type: "cascader",
    name: "级联选择",
    icon: "input-cascader",
    options: {
      name: "",
      label: "",
      defaultValue: [],
      optionItems: [
        { label: "部门一", value: "1", children: [{ label: "子部门", value: "11" }] },
        { label: "部门二", value: "2" },
        { label: "部门三", value: "3 " }
      ],
      placeholder: "",
      disabled: false,
      readonly: false,
      clearable: false,
      required: false,
      requiredMessage: "不能为空！"
    }
  },
  {
    type: "divider",
    name: "分割线",
    icon: "divider",
    options: {
      name: "",
      direction: "horizontal",
      // 分割线的方向，支持horizontal和vertical
      title: "",
      // 标题
      titlePosition: "center",
      // 分割线的标题位置，支持left、center和right
      lineStyle: "solid"
      // 分割线的样式，支持dashed和solid
    }
  },
  {
    type: "picture",
    name: "图片",
    icon: "input-picture",
    options: {
      name: "",
      label: "",
      inputAlign: "left",
      defaultValue: [],
      action: "/api/basic/image-manage/upload",
      actionBlob: "/api/basic/image-manage",
      camera: false,
      // 手机端仅拍照上传
      reduce: 1,
      // 使用压缩图片上传 0原图 1高清无损 2高质量
      limit: 10,
      fileMaxSize: 10,
      accept: "",
      tip: "最多上传10个图片",
      disabled: false,
      required: false,
      requiredMessage: "不能为空！"
    }
  },
  {
    type: "fileupload",
    name: "附件",
    icon: "input-fileupload",
    options: {
      name: "",
      label: "",
      inputAlign: "left",
      defaultValue: [],
      action: "/api/basic/image-manage/upload",
      actionBlob: "/api/basic/image-manage",
      limit: 5,
      fileMaxSize: 20,
      listType: "picture",
      accept: "",
      tip: "最多上传5个附件",
      disabled: false,
      required: false,
      requiredMessage: "不能为空！"
    }
  },
  {
    type: "signature",
    name: "签名",
    icon: "input-signature",
    options: {
      name: "",
      label: "",
      type: "png",
      penColor: "#000",
      lineWidth: 3,
      backgroundColor: "",
      clearButtonText: "清空",
      confirmButtonText: "确认",
      signText: "点击去签名",
      reSignText: "重新签名",
      disabled: false,
      required: false,
      requiredMessage: "不能为空！"
    }
  },
  {
    type: "phone",
    name: "手机",
    icon: "input-phone",
    options: {
      name: "",
      label: "",
      placeholder: "请输入手机号",
      pattern: "请输入有效的手机号码",
      readonly: false,
      workflow: true,
      required: false,
      requiredMessage: "不能为空！"
    }
  }
];
const complexFields = [
  {
    type: "computedays",
    name: "计算时长",
    icon: "input-number",
    options: {
      name: "",
      label: "",
      defaultValue: "",
      type: "number",
      placeholder: "",
      append: "天",
      selectStart: "",
      // 关联开始日期
      selectEnd: "",
      // 关联结束日期
      workdayMode: 1,
      // 0自然日 1工作日
      holidays: [
        "2025-01-01",
        // 元旦
        "2025-01-29",
        // 春节
        "2025-01-30",
        // 春节
        "2025-01-31",
        // 春节
        "2025-02-01",
        // 春节
        "2025-02-02",
        // 春节
        "2025-02-03",
        // 春节
        "2025-04-04",
        // 清明节
        "2025-04-05",
        // 清明节
        "2025-04-06",
        // 清明节
        "2025-05-01",
        // 劳动节
        "2025-05-02",
        // 劳动节
        "2025-05-03",
        // 劳动节
        "2025-06-07",
        // 端午节
        "2025-06-08",
        // 端午节
        "2025-06-09",
        // 端午节
        "2025-09-13",
        // 中秋节
        "2025-09-14",
        // 中秋节
        "2025-09-15",
        // 中秋节
        "2025-10-01",
        // 国庆节
        "2025-10-02",
        // 国庆节
        "2025-10-03",
        // 国庆节
        "2025-10-04",
        // 国庆节
        "2025-10-05",
        // 国庆节
        "2025-10-06",
        // 国庆节
        "2025-10-07"
        // 国庆节
      ],
      workdays: [
        "2025-02-08",
        // 调休工作日（春节）
        "2025-02-09",
        // 调休工作日（春节）
        "2025-04-27",
        // 调休工作日（劳动节）
        "2025-05-04",
        // 调休工作日（劳动节）
        "2025-09-28",
        // 调休工作日（国庆节）
        "2025-10-11"
        // 调休工作日（国庆节）
      ],
      workTime: [
        { start: "09:00", end: "12:00" },
        { start: "13:00", end: "18:00" }
      ],
      workflow: true,
      required: true,
      requiredMessage: "不能为空！"
    },
    hideOptions: ["required", "requiredMessage"]
  },
  {
    type: "card",
    name: "请假组件",
    icon: "card-leave",
    options: {
      name: "leave",
      publicVars: {}
    },
    components: [
      {
        type: "select",
        name: "选择器",
        icon: "input-select",
        options: {
          name: "Type",
          label: "请假类型",
          defaultValue: "",
          optionItems: [
            { label: "年假", value: "1" },
            { label: "事假", value: "2" },
            { label: "病假", value: "3" },
            { label: "调休假", value: "4" },
            { label: "婚假", value: "5" },
            { label: "丧假", value: "6" },
            { label: "产假", value: "7" },
            { label: "陪产假", value: "8" },
            { label: "产检假", value: "9" },
            { label: "哺乳假", value: "10" },
            { label: "陪考假", value: "11" },
            { label: "其他", value: "12" }
          ],
          placeholder: "请选择",
          workflow: true,
          required: true,
          requiredMessage: "请选择请假类型"
        },
        hideOptions: ["source", "action", "max", "required", "requiredMessage"]
      },
      {
        type: "date",
        name: "日期选择",
        icon: "input-date",
        options: {
          name: "BTime",
          label: "开始时间",
          defaultValue: "",
          type: "datetime",
          format: "YYYY-MM-DD HH:mm",
          placeholder: "请选择",
          required: true,
          requiredMessage: "请选择开始时间"
        },
        hideOptions: ["defaultValue", "required", "requiredMessage"],
        events: {
          onValidate: `const { BTime, ETime } = formData;\r
if(BTime && ETime) {\r
  const startTime = new Date(BTime.replace(/\\s/, "T")); // 开始时间\r
  const endTime = new Date(ETime.replace(/\\s/, "T")); // 结束时间\r
  if(startTime >= endTime) {\r
    callback('开始时间不能大于结束时间')\r
  }\r
}\r
callback()`
        }
      },
      {
        type: "date",
        name: "日期选择",
        icon: "input-date",
        options: {
          name: "ETime",
          label: "结束时间",
          defaultValue: "",
          type: "datetime",
          format: "YYYY-MM-DD HH:mm",
          placeholder: "请选择",
          required: true,
          requiredMessage: "请选择结束时间"
        },
        hideOptions: ["defaultValue", "required", "requiredMessage"]
      },
      {
        type: "computedays",
        name: "计算时长",
        icon: "input-number",
        options: {
          name: "leaveDays",
          label: "请假时长",
          defaultValue: "",
          type: "number",
          placeholder: "",
          append: "天",
          selectStart: "BTime",
          selectEnd: "ETime",
          workdayMode: 1,
          holidays: [
            "2025-01-01",
            "2025-01-29",
            "2025-01-30",
            "2025-01-31",
            "2025-02-01",
            "2025-02-02",
            "2025-02-03",
            "2025-04-04",
            "2025-04-05",
            "2025-04-06",
            "2025-05-01",
            "2025-05-02",
            "2025-05-03",
            "2025-06-07",
            "2025-06-08",
            "2025-06-09",
            "2025-09-13",
            "2025-09-14",
            "2025-09-15",
            "2025-10-01",
            "2025-10-02",
            "2025-10-03",
            "2025-10-04",
            "2025-10-05",
            "2025-10-06",
            "2025-10-07"
          ],
          workdays: ["2025-02-08", "2025-02-09", "2025-04-27", "2025-05-04", "2025-09-28", "2025-10-11"],
          workTime: [
            { start: "09:00", end: "12:00" },
            { start: "13:00", end: "18:00" }
          ],
          workflow: true
        },
        hideOptions: ["defaultValue", "selectStart", "selectEnd"]
      },
      {
        type: "textarea",
        name: "多行输入",
        icon: "input-textarea",
        options: {
          name: "remark",
          label: "请假事由",
          labelPosition: "top",
          inputAlign: "left",
          defaultValue: "",
          maxlength: "100",
          rows: 3,
          autosize: true,
          placeholder: "请输入",
          required: false,
          requiredMessage: "不能为空！"
        },
        hideOptions: ["defaultValue", "required", "requiredMessage"]
      },
      {
        type: "fileupload",
        name: "附件",
        icon: "input-fileupload",
        options: {
          name: "file",
          label: "附件",
          labelPosition: "top",
          inputAlign: "left",
          defaultValue: [],
          action: "/api/basic/image-manage/upload",
          actionBlob: "/api/basic/image-manage",
          limit: 5,
          fileMaxSize: 20,
          listType: "picture-card",
          accept: "",
          tip: "最多上传5个附件",
          disabled: false,
          required: false,
          requiredMessage: "不能为空！"
        },
        hideOptions: ["disabled"]
      }
    ]
  },
  {
    type: "card",
    name: "自定义组件",
    icon: "card",
    options: {
      name: "",
      publicVars: {}
    },
    components: []
  },
  {
    type: "correlation",
    name: "关联审批",
    icon: "input-correlation",
    options: {
      name: "",
      label: "",
      defaultValue: [],
      selectType: false,
      // 可选范围 默认全部
      selectRange: [],
      // 选择审批
      limit: 10,
      // 最大数量
      tip: "最多关联10个审批",
      // 提示
      required: false,
      requiredMessage: "不能为空！"
    }
  },
  {
    type: "amount",
    name: "金额",
    icon: "input-amount",
    options: {
      name: "",
      label: "",
      min: 0,
      max: 999999999999999,
      decimalPlaces: 2,
      // 精度
      omitEndZero: true,
      // 省略末尾0
      placeholder: "请输入金额",
      readonly: false,
      workflow: true,
      required: false,
      requiredMessage: "不能为空！"
    }
  },
  {
    type: "upperamount",
    name: "大写金额",
    icon: "input-upperamount",
    options: {
      name: "",
      label: "",
      defaultValue: "",
      maxlength: "20",
      selectSumName: "",
      // 关联金额
      placeholder: "请输入大写金额",
      readonly: false,
      required: false,
      requiredMessage: "不能为空！"
    }
  },
  {
    type: "subform",
    name: "子表单",
    icon: "input-subform",
    options: {
      name: "",
      label: "",
      defaultValue: [],
      draggable: false,
      addable: false,
      removable: false,
      disabled: false,
      readonly: false,
      required: false,
      requiredMessage: "不能为空！",
      // 子表单项
      formItems: [
        {
          type: "input",
          name: "文本输入",
          icon: "input-text",
          options: {
            name: "input80680",
            label: "标题1",
            defaultValueType: 0,
            defaultValue: "",
            defaultValueFunc: "",
            maxlength: "20",
            showWordLimit: false,
            placeholder: "可以填写任意文本",
            append: "",
            disabled: false,
            readonly: false,
            clearable: false,
            workflow: false,
            required: false,
            requiredMessage: "不能为空！"
          }
        },
        {
          type: "input",
          name: "文本输入",
          icon: "input-text",
          options: {
            name: "input80681",
            label: "标题2",
            defaultValueType: 0,
            defaultValue: "",
            defaultValueFunc: "",
            maxlength: "20",
            showWordLimit: false,
            placeholder: "可以填写任意文本",
            append: "",
            disabled: false,
            readonly: false,
            clearable: false,
            workflow: false,
            required: false,
            requiredMessage: "不能为空！"
          }
        }
      ]
    }
  }
];
const index_vue_vue_type_style_index_0_lang$3 = "";
const _sfc_main$6 = {
  components: {
    draggable
  },
  props: {
    height: {
      type: Number,
      default: 0
    },
    designer: {
      type: Object,
      default: null
    },
    /** 自定义显示组件，默认全部显示 */
    fields: {
      type: Array,
      default: null
    },
    /** 表单配置 */
    formConfig: {
      type: Object,
      default: null
    },
    /** 表单组件列表 */
    widgetList: {
      type: Array,
      default: () => []
    },
    /** 当前选中组件 */
    selected: {
      type: Object,
      default: () => {
      }
    }
  },
  emits: ["update:widgetList", "update:selected"],
  setup(props2, { emit }) {
    const { proxy } = getCurrentInstance();
    const leftTabs = ref$1("basic");
    const leftArea = ref$1(0);
    const jsonContent = computed({
      get() {
        const { widgetList, formConfig } = props2;
        return JSON.stringify({ widgetList, formConfig }, null, 2);
      }
      // set(value) {
      //   try {
      //     const parsed = JSON.parse(value)
      //     emit('update:widgetList', parsed)
      //   } catch (error) {
      //     proxy.$message.error('JSON格式错误，请检查后重试。')
      //   }
      // }
    });
    const panelHeight = computed(() => {
      return props2.height + "px";
    });
    const onlyCardName = (origin) => {
      if (origin.type !== "card") {
        return false;
      }
      return props2.widgetList.some((v) => v.type === "card");
    };
    const basicFieldsFilter = computed(
      () => basicFields.filter((m) => {
        if (props2.fields) {
          return props2.fields.includes(m.type);
        }
        return true;
      })
    );
    const complexFieldsFilter = computed(
      () => complexFields.filter((m) => {
        if (props2.fields) {
          if (m.type === "card" && m.options && m.options.name === "leave") {
            return props2.fields.includes(m.options.name);
          }
          return props2.fields.includes(m.type);
        }
        return true;
      })
    );
    const generateId = () => {
      return Math.floor(Math.random() * 1e5 + Math.random() * 2e4 + Math.random() * 5e3);
    };
    const handleFieldWidgetClone = (origin) => {
      if (onlyCardName(origin)) {
        proxy.$message.error(`不能重复添加自定义组件.`);
        return;
      }
      const newWidget = _.cloneDeep(origin);
      newWidget.id = newWidget.type.replace(/-/g, "") + generateId();
      if (newWidget.type === "card") {
        if (!newWidget.options.name) {
          newWidget.options.name = newWidget.id;
        }
        newWidget.components.forEach((item) => {
          item.id = item.type.replace(/-/g, "") + generateId();
          if (item.options.label === "") {
            item.options.label = item.name || item.type.toLowerCase();
          }
          if (!item.options.name) {
            item.options.name = item.id;
          }
        });
      } else {
        if (origin.type === "grid") {
          console.log("grid :>> ");
        } else {
          if (!newWidget.options.name) {
            newWidget.options.name = newWidget.id;
          }
          if (newWidget.options.label === "") {
            newWidget.options.label = newWidget.name || newWidget.type.toLowerCase();
          }
        }
      }
      return newWidget;
    };
    const addContainer = (origin) => {
      const newWidget = handleFieldWidgetClone(origin);
      if (newWidget) {
        console.log("props.selected :>> ", props2.selected);
        const list = props2.widgetList.filter((x) => x.id);
        if (props2.selected && props2.selected.type === "card") {
          const cardIndex = list.findIndex((x) => x.id === props2.selected.id);
          if (cardIndex !== -1) {
            list[cardIndex].components.push(newWidget);
          } else {
            proxy.$message.error(`未找到对应的自定义组件，请刷新页面重试。`);
            return;
          }
        } else {
          list.push(newWidget);
        }
        emit("update:widgetList", list);
        emit("update:selected", list[list.length - 1]);
      }
    };
    return {
      leftTabs,
      leftArea,
      jsonContent,
      panelHeight,
      basicFieldsFilter,
      complexFieldsFilter,
      handleFieldWidgetClone,
      addContainer
    };
  }
};
const _hoisted_1$6 = { class: "ep-widget-panel-container" };
const _hoisted_2$6 = { class: "left-area" };
const _hoisted_3$5 = { class: "left-panel-container" };
const _hoisted_4$3 = { class: "component-description-list" };
const _hoisted_5$1 = { class: "component-description-list-content" };
const _hoisted_6$1 = ["title", "onDblclick"];
const _hoisted_7$1 = { class: "brief-snippet-inner" };
const _hoisted_8$1 = { class: "title" };
const _hoisted_9$1 = { class: "component-description-list-content" };
const _hoisted_10$1 = ["title", "onDblclick"];
const _hoisted_11$1 = { class: "brief-snippet-inner" };
const _hoisted_12$1 = { class: "title" };
const _hoisted_13$1 = { class: "component-code-json" };
function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_m_icon = resolveComponent("m-icon");
  const _component_draggable = resolveComponent("draggable");
  const _component_el_tab_pane = resolveComponent("el-tab-pane");
  const _component_el_tabs = resolveComponent("el-tabs");
  const _component_code_editor = resolveComponent("code-editor");
  return openBlock(), createElementBlock("div", _hoisted_1$6, [
    createElementVNode("div", _hoisted_2$6, [
      createElementVNode("div", {
        class: normalizeClass(["left-area-icon", { active: $setup.leftArea === 0 }])
      }, [
        createVNode(_component_m_icon, {
          name: "line-qrcode",
          onClick: _cache[0] || (_cache[0] = ($event) => $setup.leftArea = 0)
        })
      ], 2),
      createElementVNode("div", {
        class: normalizeClass(["left-area-icon", { active: $setup.leftArea === 1 }])
      }, [
        createVNode(_component_m_icon, {
          name: "code",
          onClick: _cache[1] || (_cache[1] = ($event) => $setup.leftArea = 1)
        })
      ], 2)
    ]),
    createElementVNode("div", _hoisted_3$5, [
      $setup.leftArea === 0 ? (openBlock(), createBlock(_component_el_tabs, {
        key: 0,
        modelValue: $setup.leftTabs,
        "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.leftTabs = $event),
        stretch: ""
      }, {
        default: withCtx(() => [
          createVNode(_component_el_tab_pane, { name: "basic" }, {
            label: withCtx(() => _cache[4] || (_cache[4] = [
              createElementVNode("span", null, "基础组件", -1)
            ])),
            default: withCtx(() => [
              createElementVNode("div", _hoisted_4$3, [
                createElementVNode("div", _hoisted_5$1, [
                  _cache[5] || (_cache[5] = createElementVNode("div", { class: "component-description-list-content-header" }, [
                    createElementVNode("span", { class: "title" }, "常用")
                  ], -1)),
                  createVNode(_component_draggable, {
                    tag: "div",
                    class: "widget-panel-fields",
                    list: $setup.basicFieldsFilter,
                    "item-key": "type",
                    group: { name: "people", pull: "clone", ghostClass: "ghost", put: false },
                    clone: $setup.handleFieldWidgetClone,
                    sort: false
                  }, {
                    item: withCtx(({ element: el }) => [
                      createElementVNode("div", {
                        class: "widget-panel-fields-item",
                        title: el.name,
                        onDblclick: ($event) => $setup.addContainer(el)
                      }, [
                        createElementVNode("div", _hoisted_7$1, [
                          createVNode(_component_m_icon, {
                            name: el.icon
                          }, null, 8, ["name"]),
                          createElementVNode("div", _hoisted_8$1, toDisplayString(el.name), 1)
                        ])
                      ], 40, _hoisted_6$1)
                    ]),
                    _: 1
                  }, 8, ["list", "clone"])
                ]),
                createElementVNode("div", _hoisted_9$1, [
                  _cache[6] || (_cache[6] = createElementVNode("div", { class: "component-description-list-content-header" }, [
                    createElementVNode("span", { class: "title" }, "高级")
                  ], -1)),
                  createVNode(_component_draggable, {
                    tag: "div",
                    class: "widget-panel-fields",
                    list: $setup.complexFieldsFilter,
                    "item-key": "type",
                    group: { name: "people", pull: "clone", ghostClass: "ghost", put: false },
                    clone: $setup.handleFieldWidgetClone,
                    sort: false
                  }, {
                    item: withCtx(({ element: el }) => [
                      createElementVNode("div", {
                        class: "widget-panel-fields-item",
                        title: el.name,
                        onDblclick: ($event) => $setup.addContainer(el)
                      }, [
                        createElementVNode("div", _hoisted_11$1, [
                          createVNode(_component_m_icon, {
                            name: el.icon
                          }, null, 8, ["name"]),
                          createElementVNode("div", _hoisted_12$1, toDisplayString(el.name), 1)
                        ])
                      ], 40, _hoisted_10$1)
                    ]),
                    _: 1
                  }, 8, ["list", "clone"])
                ])
              ])
            ]),
            _: 1
          })
        ]),
        _: 1
      }, 8, ["modelValue"])) : createCommentVNode("", true),
      $setup.leftArea === 1 ? (openBlock(), createBlock(_component_el_tabs, {
        key: 1,
        "model-value": "code",
        stretch: ""
      }, {
        default: withCtx(() => [
          createVNode(_component_el_tab_pane, { name: "code" }, {
            label: withCtx(() => _cache[7] || (_cache[7] = [
              createElementVNode("span", null, "代码", -1)
            ])),
            default: withCtx(() => [
              _cache[8] || (_cache[8] = createElementVNode("div", { class: "component-description-list-content-header" }, [
                createElementVNode("span", { class: "title" }, "生成JSON")
              ], -1)),
              createElementVNode("div", _hoisted_13$1, [
                createVNode(_component_code_editor, {
                  modelValue: $setup.jsonContent,
                  "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.jsonContent = $event),
                  mode: "json",
                  "show-gutter": false,
                  "max-lines": 40,
                  "font-size": 12,
                  readonly: ""
                }, null, 8, ["modelValue"])
              ])
            ]),
            _: 1
          })
        ]),
        _: 1
      })) : createCommentVNode("", true)
    ])
  ]);
}
const WidgetPanel = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$5]]);
const defaultFormConfig = {
  pc: {
    size: "default",
    // 组件大小
    labelWidth: 100,
    // 标签宽度
    labelPosition: "left"
    // 标签位置 left right top
  },
  h5: {
    labelWidth: 80,
    // 标签宽度
    labelPosition: "left",
    // 标签位置 left right top
    inputAlign: "right"
    // 输入框对齐方式 left center right
  }
};
const index_vue_vue_type_style_index_0_lang$2 = "";
const _sfc_main$5 = {
  props: {
    /** 显示开关项 */
    options: {
      type: Object,
      default: null
    },
    /** 自定义显示组件，默认全部显示 */
    fields: {
      type: Array,
      default: null
    },
    /** 配置双向绑定 */
    modelValue: {
      type: Object,
      default: null
    },
    /** 是否显示容器 */
    show: {
      type: Boolean,
      default: true
    },
    /** 禁止移除项ids
     * 配合流程设计器使用，已作为流程判断条件不能删除 */
    usedConditionIds: {
      type: Array,
      default: null
    },
    /** 关联审批应用列表 { label, options: [{label, value}]} */
    correlationOptions: {
      type: Array,
      default: null
    }
  },
  emits: ["update:modelValue"],
  setup(props2, { emit }) {
    const { proxy } = getCurrentInstance();
    const globalConfig = {
      clearButtonShow: true,
      // 显示清空按钮
      previewButtonShow: true,
      // 显示预览按钮
      formConfigShow: true,
      // 显示表单设置项
      permissionShow: false
      // 显示组件权限项 本地测试用
    };
    _.merge(globalConfig, props2.options);
    console.log("globalConfig :>> ", globalConfig);
    const designerMain = ref$1(null);
    const designerHeight = ref$1(0);
    const state = reactive({
      widgetList: [],
      formConfig: { ...defaultFormConfig },
      selected: {}
    });
    provide("globalConfig", globalConfig);
    provide(
      "usedConditionIds",
      computed(() => props2.usedConditionIds || [])
    );
    provide(
      "correlationOptions",
      computed(() => props2.correlationOptions || [])
    );
    provide(
      "selected",
      computed(() => state.selected)
    );
    provide("setSelected", (item) => {
      state.selected = item;
    });
    const renderChange = (val) => {
      console.log("renderChange :>> ", val);
    };
    watch(
      () => props2.modelValue,
      (val) => {
        if (val) {
          _.assign(state, props2.modelValue);
        }
      },
      { deep: true }
    );
    watch(state, () => {
      const { widgetList, formConfig } = state;
      if (props2.modelValue) {
        if (JSON.stringify(props2.modelValue) !== JSON.stringify(state)) {
          emit("update:modelValue", { widgetList, formConfig });
        }
      }
    });
    const panelHeight = computed(() => designerHeight.value - 40);
    const formHeight = computed(() => designerHeight.value - 112);
    const setDesignerHeight = () => {
      if (designerMain.value && designerMain.value.$el) {
        designerHeight.value = designerMain.value.$el.offsetHeight;
      }
    };
    const isShow = computed(() => props2.show);
    watch(isShow, (val) => {
      if (val) {
        nextTick(() => {
          setDesignerHeight();
        });
      }
    });
    const isEmptyData = computed(() => state.widgetList.length === 0);
    const layoutType = ref$1("PC");
    const changeLayoutType = (newType) => {
      layoutType.value = newType;
    };
    const previewRef = ref$1(null);
    const dialogPreview = ref$1(false);
    const isH5 = ref$1(false);
    const dialogTitle = computed(() => isH5.value ? "预览 (Vant 4组件)" : "预览 (Element Plus组件)");
    const isDetail = ref$1(false);
    const submitPreview = () => {
      previewRef.value.getFormModel().then((formData) => {
        const formDataJson = JSON.stringify(formData, null, "  ");
        const formDataRawJson = JSON.stringify(formData);
        console.log("formDataJson :>> ", formDataJson);
        console.log("formDataRawJson :>> ", formDataRawJson);
        proxy.$message.success("请在控制台中查看提交数据.");
      }).catch((error) => {
        console.log("error :>> ", error);
      });
    };
    const resetPreview = () => {
      previewRef.value.clearFormModel();
    };
    const clear = () => {
      proxy.$message.confirm("清空后无法恢复，是否清空当前表单？", "提示", {
        confirmButtonText: "确认",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        if (props2.usedConditionIds && state.widgetList.length > 0) {
          if (props2.usedConditionIds.some((id) => state.widgetList.find((m) => m.id === id))) {
            proxy.$message.error("尚有组件已作为流程判断条件，无法删除.");
            return false;
          }
          const cards = state.widgetList.filter((m) => m.type === "card");
          if (cards.length > 0 && cards.some((s) => s.components.some((m) => props2.usedConditionIds.includes(m.id)))) {
            proxy.$message.error("尚有组件已作为流程判断条件，无法删除.");
            return false;
          }
        }
        _.assign(state, {
          widgetList: [],
          formConfig: { ...defaultFormConfig },
          selected: {}
        });
        proxy.$message.success("已清空.");
      }).catch((error) => {
        if (error !== "cancel") {
          console.log("error :>> ", error);
        }
      });
    };
    const permissions = ref$1(null);
    const onPermission = (value) => {
      permissions.value = value;
    };
    onMounted(() => {
      setDesignerHeight();
      window.onresize = () => {
        setDesignerHeight();
      };
    });
    onUnmounted(() => {
      window.onresize = null;
    });
    return {
      globalConfig,
      designerMain,
      designerHeight,
      state,
      panelHeight,
      formHeight,
      layoutType,
      isEmptyData,
      changeLayoutType,
      previewRef,
      dialogPreview,
      isH5,
      isDetail,
      dialogTitle,
      submitPreview,
      resetPreview,
      clear,
      renderChange,
      permissions,
      onPermission
    };
  }
};
const _hoisted_1$5 = { class: "left-toolbar" };
const _hoisted_2$5 = { class: "right-toolbar" };
const _hoisted_3$4 = { class: "dialog-footer" };
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_widget_panel = resolveComponent("widget-panel");
  const _component_Monitor = resolveComponent("Monitor");
  const _component_el_icon = resolveComponent("el-icon");
  const _component_el_button = resolveComponent("el-button");
  const _component_Cellphone = resolveComponent("Cellphone");
  const _component_Iphone = resolveComponent("Iphone");
  const _component_el_tooltip = resolveComponent("el-tooltip");
  const _component_el_button_group = resolveComponent("el-button-group");
  const _component_View = resolveComponent("View");
  const _component_Delete = resolveComponent("Delete");
  const _component_el_row = resolveComponent("el-row");
  const _component_el_card = resolveComponent("el-card");
  const _component_el_header = resolveComponent("el-header");
  const _component_widget_form = resolveComponent("widget-form");
  const _component_el_main = resolveComponent("el-main");
  const _component_el_container = resolveComponent("el-container");
  const _component_setting_panel = resolveComponent("setting-panel");
  const _component_el_aside = resolveComponent("el-aside");
  const _component_render_form = resolveComponent("render-form");
  const _component_el_scrollbar = resolveComponent("el-scrollbar");
  const _component_el_switch = resolveComponent("el-switch");
  const _component_el_dialog = resolveComponent("el-dialog");
  return openBlock(), createElementBlock(Fragment, null, [
    withDirectives(createVNode(_component_el_container, {
      ref: "designerMain",
      class: normalizeClass(["ep-designer-container", [$setup.layoutType + "-layout"]])
    }, {
      default: withCtx(() => [
        createElementVNode("div", null, [
          createVNode(_component_widget_panel, {
            "widget-list": $setup.state.widgetList,
            "onUpdate:widgetList": _cache[0] || (_cache[0] = ($event) => $setup.state.widgetList = $event),
            selected: $setup.state.selected,
            "onUpdate:selected": _cache[1] || (_cache[1] = ($event) => $setup.state.selected = $event),
            height: $setup.panelHeight,
            fields: $props.fields,
            "form-config": $setup.state.formConfig
          }, null, 8, ["widget-list", "selected", "height", "fields", "form-config"])
        ]),
        createVNode(_component_el_container, null, {
          default: withCtx(() => [
            createVNode(_component_el_header, { height: "52px" }, {
              default: withCtx(() => [
                createVNode(_component_el_card, { shadow: "never" }, {
                  default: withCtx(() => [
                    createVNode(_component_el_row, { justify: "space-between" }, {
                      default: withCtx(() => [
                        createElementVNode("div", _hoisted_1$5, [
                          createVNode(_component_el_button_group, null, {
                            default: withCtx(() => [
                              createVNode(_component_el_button, {
                                type: $setup.layoutType === "PC" ? "info" : "",
                                onClick: _cache[2] || (_cache[2] = ($event) => $setup.changeLayoutType("PC"))
                              }, {
                                default: withCtx(() => [
                                  createVNode(_component_el_icon, null, {
                                    default: withCtx(() => [
                                      createVNode(_component_Monitor)
                                    ]),
                                    _: 1
                                  }),
                                  _cache[9] || (_cache[9] = createElementVNode("span", null, "PC", -1))
                                ]),
                                _: 1
                              }, 8, ["type"]),
                              createVNode(_component_el_button, {
                                type: $setup.layoutType === "Pad" ? "info" : "",
                                onClick: _cache[3] || (_cache[3] = ($event) => $setup.changeLayoutType("Pad"))
                              }, {
                                default: withCtx(() => [
                                  createVNode(_component_el_icon, null, {
                                    default: withCtx(() => [
                                      createVNode(_component_Cellphone)
                                    ]),
                                    _: 1
                                  }),
                                  _cache[10] || (_cache[10] = createElementVNode("span", null, "Pad", -1))
                                ]),
                                _: 1
                              }, 8, ["type"]),
                              createVNode(_component_el_tooltip, {
                                class: "box-item",
                                effect: "light",
                                content: "H5移动端UI组件预览中查看",
                                placement: "bottom-start"
                              }, {
                                default: withCtx(() => [
                                  createVNode(_component_el_button, {
                                    type: $setup.layoutType === "H5" ? "info" : "",
                                    onClick: _cache[4] || (_cache[4] = ($event) => $setup.changeLayoutType("H5"))
                                  }, {
                                    default: withCtx(() => [
                                      createVNode(_component_el_icon, null, {
                                        default: withCtx(() => [
                                          createVNode(_component_Iphone)
                                        ]),
                                        _: 1
                                      }),
                                      _cache[11] || (_cache[11] = createElementVNode("span", null, "H5", -1))
                                    ]),
                                    _: 1
                                  }, 8, ["type"])
                                ]),
                                _: 1
                              })
                            ]),
                            _: 1
                          })
                        ]),
                        createElementVNode("div", _hoisted_2$5, [
                          $setup.globalConfig.previewButtonShow ? (openBlock(), createBlock(_component_el_button, {
                            key: 0,
                            type: "primary",
                            link: "",
                            size: "default",
                            disabled: $setup.isEmptyData,
                            onClick: _cache[5] || (_cache[5] = ($event) => $setup.dialogPreview = true)
                          }, {
                            default: withCtx(() => [
                              createVNode(_component_el_icon, null, {
                                default: withCtx(() => [
                                  createVNode(_component_View)
                                ]),
                                _: 1
                              }),
                              _cache[12] || (_cache[12] = createElementVNode("span", null, "预览", -1))
                            ]),
                            _: 1
                          }, 8, ["disabled"])) : createCommentVNode("", true),
                          $setup.globalConfig.clearButtonShow ? (openBlock(), createBlock(_component_el_button, {
                            key: 1,
                            type: "primary",
                            link: "",
                            size: "default",
                            disabled: $setup.isEmptyData,
                            onClick: $setup.clear
                          }, {
                            default: withCtx(() => [
                              createVNode(_component_el_icon, null, {
                                default: withCtx(() => [
                                  createVNode(_component_Delete)
                                ]),
                                _: 1
                              }),
                              _cache[13] || (_cache[13] = createElementVNode("span", null, "清空", -1))
                            ]),
                            _: 1
                          }, 8, ["disabled", "onClick"])) : createCommentVNode("", true)
                        ])
                      ]),
                      _: 1
                    })
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }),
            createVNode(_component_el_main, null, {
              default: withCtx(() => [
                createVNode(_component_widget_form, {
                  "widget-list": $setup.state.widgetList,
                  "form-config": $setup.state.formConfig,
                  "layout-type": $setup.layoutType,
                  height: $setup.formHeight
                }, null, 8, ["widget-list", "form-config", "layout-type", "height"])
              ]),
              _: 1
            })
          ]),
          _: 1
        }),
        createVNode(_component_el_aside, { width: "320px" }, {
          default: withCtx(() => [
            createVNode(_component_setting_panel, {
              "form-config": $setup.state.formConfig,
              selected: $setup.state.selected,
              "widget-list": $setup.state.widgetList,
              "layout-type": $setup.layoutType,
              height: $setup.panelHeight,
              onOnPermission: $setup.onPermission
            }, null, 8, ["form-config", "selected", "widget-list", "layout-type", "height", "onOnPermission"])
          ]),
          _: 1
        })
      ]),
      _: 1
    }, 8, ["class"]), [
      [vShow, $props.show]
    ]),
    createVNode(_component_el_dialog, {
      modelValue: $setup.dialogPreview,
      "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => $setup.dialogPreview = $event),
      title: "预览",
      width: $setup.isH5 ? "375px" : "50%",
      "close-on-click-modal": false,
      "close-on-press-escape": false,
      class: normalizeClass($setup.isH5 ? "ep-dialog-H5" : "ep-dialog-PC"),
      "destroy-on-close": ""
    }, {
      footer: withCtx(() => [
        createElementVNode("span", _hoisted_3$4, [
          createVNode(_component_el_switch, {
            modelValue: $setup.isDetail,
            "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => $setup.isDetail = $event),
            "inactive-text": "Detail",
            style: { "margin-right": "20px" }
          }, null, 8, ["modelValue"]),
          createVNode(_component_el_switch, {
            modelValue: $setup.isH5,
            "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => $setup.isH5 = $event),
            "inactive-text": "H5",
            style: { "margin-right": "20px" }
          }, null, 8, ["modelValue"]),
          createVNode(_component_el_button, { onClick: $setup.resetPreview }, {
            default: withCtx(() => _cache[14] || (_cache[14] = [
              createTextVNode("重置")
            ])),
            _: 1
          }, 8, ["onClick"]),
          createVNode(_component_el_button, {
            type: "primary",
            onClick: $setup.submitPreview
          }, {
            default: withCtx(() => _cache[15] || (_cache[15] = [
              createTextVNode("提交")
            ])),
            _: 1
          }, 8, ["onClick"])
        ])
      ]),
      default: withCtx(() => [
        createVNode(_component_el_scrollbar, null, {
          default: withCtx(() => [
            createVNode(_component_render_form, {
              ref: "previewRef",
              "json-object": $setup.state,
              h5: $setup.isH5,
              detail: $setup.isDetail,
              permissions: $setup.permissions,
              onChange: $setup.renderChange
            }, null, 8, ["json-object", "h5", "detail", "permissions", "onChange"])
          ]),
          _: 1
        })
      ]),
      _: 1
    }, 8, ["modelValue", "width", "class"])
  ], 64);
}
const Designer = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$4]]);
const index_vue_vue_type_style_index_0_lang$1 = "";
const _sfc_main$4 = {
  props: {
    /** 配置双向绑定 */
    modelValue: {
      type: Object,
      default: () => {
      }
    },
    /** 添加按钮名称 */
    addBtn: {
      type: String,
      default: "提交项"
    },
    /** 禁止修改 */
    disabled: {
      type: Boolean,
      default: false
    }
  },
  emits: ["update:modelValue"],
  setup(props2, { emit }) {
    const formConfig = _.defaultsDeep(
      props2.modelValue.formConfig || {
        h5: {
          labelWidth: 80,
          // 标签宽度
          labelPosition: "top",
          // 标签位置 left right top
          inputAlign: "right"
          // 输入框对齐方式 left center right
        }
      },
      defaultFormConfig
    );
    if (!Array.isArray(props2.modelValue.widgetList)) {
      emit("update:modelValue", { widgetList: [], formConfig });
    }
    const designerCardList = computed(() => props2.modelValue.widgetList);
    const generateId = () => {
      return Math.floor(Math.random() * 1e5 + Math.random() * 2e4 + Math.random() * 5e3);
    };
    const showAdd = ref$1(false);
    const onShowAdd = () => {
      if (props2.disabled)
        return false;
      showAdd.value = true;
    };
    const addInput = () => {
      const id = "input" + generateId();
      designerCardList.value.push({
        id,
        type: "input",
        name: "文本输入",
        icon: "input-text",
        options: {
          name: id,
          label: "",
          defaultValueType: 0,
          // 0自定义 1公式编辑
          defaultValue: "",
          defaultValueFunc: "",
          // 公式表达式
          maxlength: "20",
          showWordLimit: false,
          placeholder: "可以填写任意文本",
          append: "",
          disabled: false,
          readonly: false,
          clearable: false,
          workflow: true,
          // 加入审批流程条件使用
          required: false,
          requiredMessage: "不能为空！"
        }
      });
      showAdd.value = false;
    };
    const addTextarea = () => {
      const id = "textarea" + generateId();
      designerCardList.value.push({
        id,
        type: "textarea",
        name: "多行输入",
        icon: "input-textarea",
        options: {
          name: id,
          label: "",
          defaultValue: "",
          maxlength: "3000",
          rows: 3,
          autosize: true,
          showWordLimit: true,
          ellipsis: 3,
          // 详情展示的行数
          expandTips: "展开",
          retractTips: "收起",
          placeholder: "可以填写任意文本",
          disabled: false,
          readonly: false,
          workflow: false,
          required: false,
          requiredMessage: "不能为空！"
        }
      });
      showAdd.value = false;
    };
    const addNumber = () => {
      const id = "number" + generateId();
      designerCardList.value.push({
        id,
        type: "number",
        name: "数字输入",
        icon: "input-number",
        options: {
          name: id,
          label: "",
          defaultValue: 0,
          min: 0,
          max: 9999,
          placeholder: "只能填写数字",
          append: "",
          disabled: false,
          readonly: false,
          workflow: true,
          required: false,
          requiredMessage: "不能为空！"
        }
      });
      showAdd.value = false;
    };
    const addRadio = () => {
      const id = "radio" + generateId();
      designerCardList.value.push({
        type: "radio",
        name: "单项选择",
        icon: "input-radio",
        options: {
          name: id,
          label: "",
          defaultValue: "1",
          optionItems: [
            { label: "选项一", value: "1" },
            { label: "选项二", value: "2" },
            { label: "选项三", value: "3" }
          ],
          inline: true,
          // 是否显示为一行
          disabled: false,
          workflow: true,
          required: false,
          requiredMessage: "不能为空！"
        }
      });
      showAdd.value = false;
    };
    const addCheckbox = () => {
      const id = "checkbox" + generateId();
      designerCardList.value.push({
        id,
        type: "checkbox",
        name: "多项选择",
        icon: "input-checkbox",
        options: {
          name: id,
          label: "",
          defaultValue: [],
          optionItems: [
            { label: "选项一", value: "1" },
            { label: "选项二", value: "2" },
            { label: "选项三", value: "3" }
          ],
          inline: true,
          // 是否显示为一行
          disabled: false,
          workflow: true,
          required: false,
          requiredMessage: "不能为空！"
        }
      });
      showAdd.value = false;
    };
    const addSelect = () => {
      const id = "select" + generateId();
      designerCardList.value.push({
        id,
        type: "select",
        name: "选择列表",
        icon: "input-select",
        options: {
          name: id,
          label: "",
          defaultValue: "1",
          optionItems: [
            { label: "选项一", value: "1" },
            { label: "选项二", value: "2" },
            { label: "选项三", value: "3" }
          ],
          placeholder: "请选择",
          disabled: false,
          clearable: false,
          workflow: true,
          required: false,
          requiredMessage: "不能为空！"
        }
      });
      showAdd.value = false;
    };
    const addPicture = () => {
      const id = "picture" + generateId();
      designerCardList.value.push({
        id,
        type: "picture",
        name: "图片",
        icon: "input-picture",
        options: {
          name: id,
          label: "",
          inputAlign: "left",
          defaultValue: [],
          action: "/api/basic/image-manage/upload",
          actionBlob: "/api/basic/image-manage",
          camera: false,
          // 手机端仅拍照上传
          reduce: 1,
          // 使用压缩图片上传 0原图 1高清无损 2高质量
          limit: 10,
          fileMaxSize: 10,
          accept: "",
          tip: "最多上传10个图片",
          disabled: false,
          required: false,
          requiredMessage: "不能为空！"
        }
      });
      showAdd.value = false;
    };
    const addFileupload = () => {
      const id = "fileupload" + generateId();
      designerCardList.value.push({
        id,
        type: "fileupload",
        name: "附件",
        icon: "input-fileupload",
        options: {
          name: id,
          label: "",
          inputAlign: "left",
          defaultValue: [],
          action: "/api/basic/image-manage/upload",
          actionBlob: "/api/basic/image-manage",
          limit: 5,
          fileMaxSize: 20,
          listType: "picture",
          accept: "",
          tip: "最多上传5个附件",
          disabled: false,
          required: false,
          requiredMessage: "不能为空！"
        }
      });
      showAdd.value = false;
    };
    const addSignature = () => {
      const id = "signature" + generateId();
      designerCardList.value.push({
        id,
        type: "signature",
        name: "签名",
        icon: "input-signature",
        options: {
          name: id,
          label: "",
          type: "png",
          penColor: "#000",
          lineWidth: 3,
          backgroundColor: "",
          clearButtonText: "清空",
          confirmButtonText: "确认",
          signText: "点击去签名",
          reSignText: "重新签名",
          disabled: false,
          required: false,
          requiredMessage: "不能为空！"
        }
      });
      showAdd.value = false;
    };
    const labelNum = (index) => index < 10 ? `0${index}.` : `${index}.`;
    const iconColor = (index, last) => {
      if (last) {
        if (index === designerCardList.value.length - 1) {
          return "#999";
        }
      } else {
        if (index === 0) {
          return "#999";
        }
      }
      return "#4A4A4A";
    };
    const addOptionItem = (item) => {
      if (props2.disabled)
        return false;
      if (Array.isArray(item.options.optionItems)) {
        const last = item.options.optionItems[item.options.optionItems.length - 1];
        if (last) {
          item.options.optionItems.push({ label: "", value: Number(last.value) + 1 });
        } else {
          item.options.optionItems.push({ label: "", value: Number(item.options.optionItems.length) + 1 });
        }
      }
    };
    const delOptionItem = (item, index) => {
      if (props2.disabled)
        return false;
      if (Array.isArray(item.options.optionItems)) {
        if (item.options.optionItems.length <= 2) {
          return showToast("至少要保留两个选项");
        }
        item.options.optionItems.splice(index, 1);
      }
    };
    const moveUp = (index) => {
      if (props2.disabled)
        return false;
      if (index === 0) {
        return false;
      }
      designerCardList.value.splice(
        index,
        1,
        ...designerCardList.value.splice(index - 1, 1, designerCardList.value[index])
      );
    };
    const moveDown = (index) => {
      if (props2.disabled)
        return false;
      if (index === designerCardList.value.length - 1) {
        return false;
      }
      designerCardList.value.splice(
        index,
        1,
        ...designerCardList.value.splice(index + 1, 1, designerCardList.value[index])
      );
    };
    const showDialog = ref$1(false);
    const onShowTextareaSetting = (item) => {
      if (props2.disabled)
        return false;
      selected.value = item;
      console.log("item :>> ", item);
      showDialog.value = true;
    };
    const showAction = ref$1(false);
    const selected = ref$1(null);
    const actions = [{ name: "删除" }];
    const onShowAction = (item) => {
      if (props2.disabled)
        return false;
      selected.value = item;
      showAction.value = true;
    };
    const onActionSelect = (action, index) => {
      if (props2.disabled)
        return false;
      if (selected.value) {
        const n = designerCardList.value.findIndex((m) => m === selected.value);
        designerCardList.value.splice(n, 1);
      }
    };
    const verification = (message = true) => {
      return new Promise((resolve, reject) => {
        const checked = [];
        designerCardList.value.forEach((e, index) => {
          if (!e.options.label) {
            checked.push(index + 1);
          }
        });
        if (checked.length > 0) {
          if (message) {
            showToast(`第 ${checked.join("、")} 个标题不能为空`);
          }
          return reject({ label: true, error: checked });
        }
        designerCardList.value.forEach((e, index) => {
          if (e.options.optionItems) {
            const option = e.options.optionItems.some((v) => !v.label);
            if (option) {
              checked.push(index + 1);
            }
          }
        });
        if (checked.length > 0) {
          if (message) {
            showToast(`第 ${checked.join("、")} 个选项名称不能为空`);
          }
          return reject({ option: true, error: checked });
        }
        resolve();
      });
    };
    onMounted(() => {
    });
    return {
      designerCardList,
      labelNum,
      iconColor,
      addOptionItem,
      delOptionItem,
      moveUp,
      moveDown,
      showAdd,
      showDialog,
      showAction,
      selected,
      actions,
      onShowAdd,
      onShowTextareaSetting,
      onShowAction,
      onActionSelect,
      addInput,
      addNumber,
      addTextarea,
      addRadio,
      addCheckbox,
      addSelect,
      addPicture,
      addFileupload,
      addSignature,
      verification
    };
  }
};
const _hoisted_1$4 = { class: "m-designer" };
const _hoisted_2$4 = { class: "m-designer-card-wrapper" };
const _hoisted_3$3 = { class: "title" };
const _hoisted_4$2 = { key: 0 };
const _hoisted_5 = { class: "uploader-card" };
const _hoisted_6 = { key: 1 };
const _hoisted_7 = {
  key: 0,
  class: "uploader-card"
};
const _hoisted_8 = {
  key: 1,
  class: "uploader-file"
};
const _hoisted_9 = { class: "tip" };
const _hoisted_10 = {
  key: 2,
  class: "signature"
};
const _hoisted_11 = {
  key: 3,
  class: "value"
};
const _hoisted_12 = { class: "footer" };
const _hoisted_13 = { class: "left" };
const _hoisted_14 = { key: 0 };
const _hoisted_15 = ["onClick"];
const _hoisted_16 = {
  key: 1,
  class: "input"
};
const _hoisted_17 = {
  key: 2,
  class: "input"
};
const _hoisted_18 = { class: "right" };
const _hoisted_19 = { class: "m-designer-create" };
const _hoisted_20 = { class: "m-designer-create-wrapper" };
const _hoisted_21 = {
  key: 0,
  class: "dialog-content"
};
const _hoisted_22 = {
  key: 1,
  class: "dialog-content"
};
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_van_field = resolveComponent("van-field");
  const _component_van_icon = resolveComponent("van-icon");
  const _component_van_button = resolveComponent("van-button");
  const _component_van_checkbox = resolveComponent("van-checkbox");
  const _component_m_icon = resolveComponent("m-icon");
  const _component_van_popup = resolveComponent("van-popup");
  const _component_van_action_sheet = resolveComponent("van-action-sheet");
  const _component_van_dialog = resolveComponent("van-dialog");
  return openBlock(), createElementBlock("div", _hoisted_1$4, [
    (openBlock(true), createElementBlock(Fragment, null, renderList($setup.designerCardList, (item, i) => {
      return openBlock(), createElementBlock("div", {
        key: i,
        class: "m-designer-card"
      }, [
        createElementVNode("div", _hoisted_2$4, [
          createElementVNode("div", _hoisted_3$3, [
            createVNode(_component_van_field, {
              modelValue: item.options.label,
              "onUpdate:modelValue": ($event) => item.options.label = $event,
              type: "textarea",
              rows: "1",
              autosize: "",
              maxlength: "200",
              label: $setup.labelNum(i + 1),
              placeholder: "请输入标题",
              required: item.options.required,
              border: false,
              readonly: $props.disabled
            }, null, 8, ["modelValue", "onUpdate:modelValue", "label", "required", "readonly"]),
            createVNode(_component_van_icon, {
              name: "jiantoushang",
              "class-prefix": "m-icon",
              color: $setup.iconColor(i, 0),
              onClick: ($event) => $setup.moveUp(i)
            }, null, 8, ["color", "onClick"]),
            createVNode(_component_van_icon, {
              name: "jiantouxia",
              "class-prefix": "m-icon",
              color: $setup.iconColor(i, 1),
              onClick: ($event) => $setup.moveDown(i)
            }, null, 8, ["color", "onClick"])
          ]),
          item.type === "picture" ? (openBlock(), createElementBlock("div", _hoisted_4$2, [
            createElementVNode("div", _hoisted_5, [
              createVNode(_component_van_icon, { name: "photograph" }),
              createElementVNode("div", null, [
                createElementVNode("span", null, toDisplayString(item.options.tip), 1)
              ])
            ])
          ])) : item.type === "fileupload" ? (openBlock(), createElementBlock("div", _hoisted_6, [
            item.options.listType === "picture-card" ? (openBlock(), createElementBlock("div", _hoisted_7, [
              createVNode(_component_van_icon, { name: "photograph" }),
              createElementVNode("div", null, [
                createElementVNode("span", null, toDisplayString(item.options.tip), 1)
              ])
            ])) : (openBlock(), createElementBlock("div", _hoisted_8, [
              createVNode(_component_van_button, {
                icon: "plus",
                type: "primary",
                size: "small",
                disabled: ""
              }, {
                default: withCtx(() => _cache[15] || (_cache[15] = [
                  createTextVNode("上传文件")
                ])),
                _: 1
              }),
              createElementVNode("div", _hoisted_9, [
                createElementVNode("span", null, toDisplayString(item.options.tip), 1)
              ])
            ]))
          ])) : item.type === "signature" ? (openBlock(), createElementBlock("div", _hoisted_10, [
            createVNode(_component_van_icon, {
              name: "edit",
              class: "icon"
            }),
            createElementVNode("div", null, [
              createElementVNode("span", null, toDisplayString(item.options.signText), 1)
            ])
          ])) : (openBlock(), createElementBlock("div", _hoisted_11, [
            item.type === "textarea" ? (openBlock(), createBlock(_component_van_field, {
              key: 0,
              type: "textarea",
              rows: "1",
              autosize: "",
              maxlength: item.options.maxlength,
              "show-word-limit": "",
              readonly: "",
              placeholder: item.options.placeholder,
              onClickInput: withModifiers(($event) => $setup.onShowTextareaSetting(item), ["stop"])
            }, null, 8, ["maxlength", "placeholder", "onClickInput"])) : item.options.optionItems ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(item.options.optionItems, (opt, n) => {
              return openBlock(), createBlock(_component_van_field, {
                key: n,
                modelValue: opt.label,
                "onUpdate:modelValue": ($event) => opt.label = $event,
                placeholder: item.options.placeholder,
                readonly: $props.disabled
              }, {
                "left-icon": withCtx(() => [
                  createVNode(_component_van_icon, {
                    name: "remove",
                    "class-prefix": "m-icon",
                    color: "#FF4848",
                    onClick: ($event) => $setup.delOptionItem(item, n)
                  }, null, 8, ["onClick"])
                ]),
                _: 2
              }, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "readonly"]);
            }), 128)) : (openBlock(), createBlock(_component_van_field, {
              key: 2,
              readonly: "",
              placeholder: item.options.placeholder,
              onClickInput: withModifiers(($event) => $setup.onShowTextareaSetting(item), ["stop"])
            }, null, 8, ["placeholder", "onClickInput"]))
          ])),
          createElementVNode("div", _hoisted_12, [
            createElementVNode("div", _hoisted_13, [
              item.options.optionItems ? (openBlock(), createElementBlock("div", _hoisted_14, [
                createElementVNode("span", {
                  class: "primary",
                  onClick: ($event) => $setup.addOptionItem(item)
                }, [
                  createVNode(_component_van_icon, { name: "add-o" }),
                  _cache[16] || (_cache[16] = createTextVNode("选项"))
                ], 8, _hoisted_15)
              ])) : createCommentVNode("", true),
              item.type === "picture" ? (openBlock(), createElementBlock("div", _hoisted_16, [
                createVNode(_component_van_field, {
                  modelValue: item.options.accept,
                  "onUpdate:modelValue": ($event) => item.options.accept = $event,
                  maxlength: "100",
                  placeholder: "限制图片类型 如：.jpg,.jpeg,.png"
                }, null, 8, ["modelValue", "onUpdate:modelValue"])
              ])) : createCommentVNode("", true),
              item.type === "fileupload" ? (openBlock(), createElementBlock("div", _hoisted_17, [
                createVNode(_component_van_field, {
                  modelValue: item.options.accept,
                  "onUpdate:modelValue": ($event) => item.options.accept = $event,
                  maxlength: "100",
                  placeholder: "限制文件类型 如：.doc,.docx,.pdf"
                }, null, 8, ["modelValue", "onUpdate:modelValue"])
              ])) : createCommentVNode("", true)
            ]),
            createElementVNode("div", _hoisted_18, [
              createElementVNode("span", null, [
                createVNode(_component_van_checkbox, {
                  modelValue: item.options.required,
                  "onUpdate:modelValue": ($event) => item.options.required = $event,
                  disabled: $props.disabled
                }, {
                  default: withCtx(() => _cache[17] || (_cache[17] = [
                    createTextVNode("必填")
                  ])),
                  _: 2
                }, 1032, ["modelValue", "onUpdate:modelValue", "disabled"])
              ]),
              createVNode(_component_van_icon, {
                name: "ellipsis",
                onClick: ($event) => $setup.onShowAction(item)
              }, null, 8, ["onClick"])
            ])
          ])
        ])
      ]);
    }), 128)),
    createElementVNode("div", {
      class: "m-designer-btn-add",
      onClick: _cache[0] || (_cache[0] = (...args) => $setup.onShowAdd && $setup.onShowAdd(...args))
    }, [
      createVNode(_component_van_icon, { name: "plus" }),
      createTextVNode(toDisplayString($props.addBtn), 1)
    ]),
    createVNode(_component_van_popup, {
      show: $setup.showAdd,
      "onUpdate:show": _cache[9] || (_cache[9] = ($event) => $setup.showAdd = $event),
      round: "",
      position: "bottom"
    }, {
      default: withCtx(() => [
        createElementVNode("div", _hoisted_19, [
          _cache[26] || (_cache[26] = createElementVNode("div", { class: "m-designer-create-header" }, "添加表单项类型", -1)),
          createElementVNode("div", _hoisted_20, [
            createElementVNode("div", {
              class: "item",
              onClick: _cache[1] || (_cache[1] = (...args) => $setup.addTextarea && $setup.addTextarea(...args))
            }, [
              createVNode(_component_m_icon, { name: "input-textarea" }),
              _cache[18] || (_cache[18] = createElementVNode("div", null, "文本填空", -1))
            ]),
            createElementVNode("div", {
              class: "item",
              onClick: _cache[2] || (_cache[2] = (...args) => $setup.addNumber && $setup.addNumber(...args))
            }, [
              createVNode(_component_m_icon, { name: "input-number" }),
              _cache[19] || (_cache[19] = createElementVNode("div", null, "数字填空", -1))
            ]),
            createElementVNode("div", {
              class: "item",
              onClick: _cache[3] || (_cache[3] = (...args) => $setup.addRadio && $setup.addRadio(...args))
            }, [
              createVNode(_component_m_icon, { name: "input-radio" }),
              _cache[20] || (_cache[20] = createElementVNode("div", null, "单选", -1))
            ]),
            createElementVNode("div", {
              class: "item",
              onClick: _cache[4] || (_cache[4] = (...args) => $setup.addCheckbox && $setup.addCheckbox(...args))
            }, [
              createVNode(_component_m_icon, { name: "input-checkbox" }),
              _cache[21] || (_cache[21] = createElementVNode("div", null, "多选", -1))
            ]),
            createElementVNode("div", {
              class: "item",
              onClick: _cache[5] || (_cache[5] = (...args) => $setup.addSelect && $setup.addSelect(...args))
            }, [
              createVNode(_component_m_icon, { name: "input-select" }),
              _cache[22] || (_cache[22] = createElementVNode("div", null, "选择列表", -1))
            ]),
            createElementVNode("div", {
              class: "item",
              onClick: _cache[6] || (_cache[6] = (...args) => $setup.addPicture && $setup.addPicture(...args))
            }, [
              createVNode(_component_m_icon, { name: "input-picture" }),
              _cache[23] || (_cache[23] = createElementVNode("div", null, "图片", -1))
            ]),
            createElementVNode("div", {
              class: "item",
              onClick: _cache[7] || (_cache[7] = (...args) => $setup.addFileupload && $setup.addFileupload(...args))
            }, [
              createVNode(_component_m_icon, { name: "input-fileupload" }),
              _cache[24] || (_cache[24] = createElementVNode("div", null, "附件", -1))
            ]),
            createElementVNode("div", {
              class: "item",
              onClick: _cache[8] || (_cache[8] = (...args) => $setup.addSignature && $setup.addSignature(...args))
            }, [
              createVNode(_component_m_icon, { name: "input-signature" }),
              _cache[25] || (_cache[25] = createElementVNode("div", null, "签名", -1))
            ])
          ])
        ])
      ]),
      _: 1
    }, 8, ["show"]),
    createVNode(_component_van_action_sheet, {
      show: $setup.showAction,
      "onUpdate:show": _cache[10] || (_cache[10] = ($event) => $setup.showAction = $event),
      actions: $setup.actions,
      "cancel-text": "取消",
      "close-on-click-action": "",
      onSelect: $setup.onActionSelect
    }, null, 8, ["show", "actions", "onSelect"]),
    createVNode(_component_van_dialog, {
      show: $setup.showDialog,
      "onUpdate:show": _cache[14] || (_cache[14] = ($event) => $setup.showDialog = $event),
      title: "选项设置",
      width: "280",
      "show-cancel-button": ""
    }, {
      default: withCtx(() => [
        $setup.selected.type === "textarea" ? (openBlock(), createElementBlock("div", _hoisted_21, [
          createVNode(_component_van_field, {
            modelValue: $setup.selected.options.maxlength,
            "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => $setup.selected.options.maxlength = $event),
            type: "digit",
            min: 10,
            max: 3e3,
            label: "最大字符数",
            placeholder: "请输入整数"
          }, null, 8, ["modelValue"])
        ])) : createCommentVNode("", true),
        $setup.selected.type === "input" && $setup.selected.options.type === "number" ? (openBlock(), createElementBlock("div", _hoisted_22, [
          createVNode(_component_van_field, {
            modelValue: $setup.selected.options.min,
            "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => $setup.selected.options.min = $event),
            type: "digit",
            min: 0,
            max: $setup.selected.options.max,
            label: "最小值",
            placeholder: "请输入整数"
          }, null, 8, ["modelValue", "max"]),
          createVNode(_component_van_field, {
            modelValue: $setup.selected.options.max,
            "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => $setup.selected.options.max = $event),
            type: "digit",
            min: $setup.selected.options.min,
            max: 999999999,
            label: "最大值",
            placeholder: "请输入整数"
          }, null, 8, ["modelValue", "min"])
        ])) : createCommentVNode("", true)
      ]),
      _: 1
    }, 8, ["show"])
  ]);
}
const DesignerMobile = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$3]]);
const index_vue_vue_type_style_index_0_scoped_97edd3d5_lang = "";
const _sfc_main$3 = {
  name: "DetailForm",
  props: {
    /** 是否渲染H5 UI组件 */
    h5: {
      type: Boolean,
      default: false
    },
    /** 表单组件列表 */
    widgetList: {
      type: Object,
      required: true
    },
    /** 表单展示数据 */
    formData: {
      type: Object,
      required: true
    },
    /** 字体颜色 */
    color: {
      type: String,
      default: null
    },
    /** 字体大小 */
    fontSize: {
      type: [String, Number],
      default: null
    },
    /** 标题颜色 */
    labelColor: {
      type: String,
      default: null
    },
    /** 标题大小 */
    labelFontSize: {
      type: [String, Number],
      default: null
    },
    /** 标题宽度 */
    labelWidth: {
      type: [String, Number],
      default: null
    },
    /** 附加样式 */
    cellClass: {
      type: String,
      default: ""
    },
    /** 隐藏el-form字段 */
    hideElform: {
      type: Boolean,
      default: false
    }
  },
  setup(props2) {
    getCurrentInstance();
    const cellStype = computed(() => {
      const style = {};
      if (props2.color) {
        style.color = props2.color;
      }
      if (props2.fontSize) {
        if (typeof props2.fontSize === "number") {
          style.fontSize = props2.fontSize + "px";
        }
        if (typeof props2.fontSize === "string") {
          style.fontSize = props2.fontSize;
        }
      }
      return style;
    });
    const formLabelWidth = computed(() => {
      if (props2.labelWidth) {
        if (typeof props2.labelWidth === "number") {
          return props2.labelWidth + "px";
        }
        if (typeof props2.labelWidth === "string") {
          return props2.labelWidth;
        }
      }
      return "80px";
    });
    const detailCells = computed(() => {
      const list = [];
      props2.widgetList.forEach((item) => {
        if (item.type === "card") {
          item.components.forEach((e) => {
            list.push(addItem(e));
          });
        } else {
          list.push(addItem(item));
        }
      });
      if (props2.hideElform) {
        return list.filter((x) => !x.widget);
      }
      return list;
    });
    const addItem = (item) => {
      const { name, label: title } = item.options;
      const obj = {
        name,
        title,
        value: props2.formData[name]
      };
      if (item.type === "input" && item.options.append) {
        obj.append = item.options.append;
      }
      if (item.type === "select") {
        const { optionItems: optionItems2, _optionItems } = item.options;
        if (_optionItems) {
          const first = _optionItems.find((m) => String(m.value) === String(obj.value));
          if (first) {
            obj.value = first.label;
          }
        } else {
          const first = optionItems2.find((m) => String(m.value) === String(obj.value));
          if (first) {
            obj.value = first.label;
          }
        }
      }
      if (item.type === "fileupload" || item.type === "correlation") {
        obj.widget = item;
      }
      return obj;
    };
    onMounted(() => {
      props2.widgetList.forEach((item) => {
        if (item.type === "select") {
          const { source, action } = item.options;
          if (source === "dynamic") {
            axios.get(action).then((res) => {
              console.log("res :>> ", res);
              item.options["_optionItems"] = res.data.result || res.data;
            }).catch((error) => {
              console.log("error :>> ", error);
            });
          }
        }
      });
    });
    return {
      cellStype,
      formLabelWidth,
      detailCells
    };
  }
};
const _hoisted_1$3 = {
  key: 0,
  class: "detail-cell__filelist"
};
const _hoisted_2$3 = { class: "detail-cell__title" };
const _hoisted_3$2 = { class: "detail-cell__value" };
const _hoisted_4$1 = {
  key: 0,
  class: "detail-cell__append"
};
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_m_fileupload = resolveComponent("m-fileupload");
  const _component_m_correlation = resolveComponent("m-correlation");
  return openBlock(), createElementBlock("div", {
    class: normalizeClass(["detail-form", $props.h5 ? "h5-container" : "ep-container"])
  }, [
    (openBlock(true), createElementBlock(Fragment, null, renderList($setup.detailCells, (item, index) => {
      return openBlock(), createElementBlock("div", {
        key: index,
        class: normalizeClass(["detail-cell", $props.cellClass]),
        style: normalizeStyle($setup.cellStype)
      }, [
        item.widget ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
          item.widget.type === "fileupload" ? (openBlock(), createBlock(_component_m_fileupload, {
            key: 0,
            "model-value": item.value,
            item: item.widget,
            index: 0,
            h5: $props.h5,
            detail: ""
          }, null, 8, ["model-value", "item", "h5"])) : createCommentVNode("", true),
          item.widget.type === "correlation" ? (openBlock(), createBlock(_component_m_correlation, {
            key: 1,
            "model-value": item.value,
            item: item.widget,
            index: 0,
            h5: $props.h5,
            detail: ""
          }, createSlots({ _: 2 }, [
            _ctx.$slots.correlation ? {
              name: "default",
              fn: withCtx(({ item: correlationItem }) => [
                renderSlot(_ctx.$slots, "correlation", { item: correlationItem }, void 0, true)
              ]),
              key: "0"
            } : void 0
          ]), 1032, ["model-value", "item", "h5"])) : createCommentVNode("", true)
        ])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
          createElementVNode("div", _hoisted_2$3, toDisplayString(item.title), 1),
          createElementVNode("div", _hoisted_3$2, [
            createTextVNode(toDisplayString(item.value) + " ", 1),
            item.append ? (openBlock(), createElementBlock("span", _hoisted_4$1, toDisplayString(item.append), 1)) : createCommentVNode("", true)
          ])
        ], 64))
      ], 6);
    }), 128))
  ], 2);
}
const DetailForm = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2], ["__scopeId", "data-v-97edd3d5"]]);
const index_vue_vue_type_style_index_0_lang = "";
const _sfc_main$2 = {
  name: "RenderForm",
  props: {
    /** 是否渲染H5 UI组件 */
    h5: {
      type: Boolean,
      default: false
    },
    /** Json表单配置 */
    jsonObject: {
      type: Object,
      required: true
    },
    /** 表单数据 */
    formData: {
      type: Object,
      default: null
    },
    /**
     * 组件权限 0可编辑 1只读 2隐藏
     * key value
     */
    permissions: {
      type: Object,
      default: null
    },
    /** 详情页中展示 */
    detail: {
      type: Boolean,
      default: false
    }
  },
  emits: ["change"],
  setup(props2, { emit }) {
    const _filterWidget = (list, permissions) => {
      const widgetList2 = [];
      if (list && Array.isArray(list)) {
        for (let index = 0; index < list.length; index++) {
          const item = _.cloneDeep(list[index]);
          if (item.type === "card" && item.components) {
            widgetList2.push(..._filterWidget(item.components, permissions));
          } else {
            item.permission = 0;
            if (permissions && permissions[item.id] !== void 0) {
              item.permission = permissions[item.id];
            }
            widgetList2.push(item);
          }
        }
      }
      return widgetList2;
    };
    const widgetList = computed(() => {
      const list = _filterWidget(props2.jsonObject.widgetList, props2.permissions);
      return list;
    });
    const widgetFormRef = ref$1(null);
    const widgetTypes = ["input", "textarea", "number", "radio", "checkbox", "select", "computedays", "amount"];
    const formModel = ref$1({});
    watch(
      () => props2.formData,
      (val) => {
        if (val) {
          formModel.value = _.cloneDeep(val);
        }
      },
      { immediate: true }
    );
    watch(
      () => _.cloneDeep(formModel.value),
      (val, oldVal) => {
        const { widgetList: widgetList2 } = props2.jsonObject;
        if (widgetList2) {
          const filter = widgetList2.filter((m) => widgetTypes.includes(m.type) && m.options && m.options.workflow);
          const names = filter.map((p) => p.options.name);
          const cardFilter = widgetList2.filter((m) => m.type === "card");
          if (cardFilter.length > 0) {
            const cardNames = cardFilter.map((c) => c.components).flat().filter((m) => widgetTypes.includes(m.type) && m.options && m.options.workflow).map((c) => c.options.name);
            names.push(...cardNames);
          }
          const change = Object.keys(val).some((k) => names.includes(k) && val[k] !== oldVal[k]);
          if (change) {
            emit("change", val);
          }
        }
      }
    );
    const getFormModel = () => {
      return new Promise((resolve, reject) => {
        widgetFormRef.value.validate().then(() => {
          resolve(formModel.value);
        }).catch((error) => {
          reject(error);
        });
      });
    };
    const clearFormModel = () => {
      if (props2.h5) {
        formModel.value = _.cloneDeep(props2.formData || {});
        widgetFormRef.value.resetValidation();
      } else {
        widgetFormRef.value.resetFields();
      }
    };
    return {
      widgetFormRef,
      formModel,
      widgetList,
      getFormModel,
      clearFormModel
    };
  }
};
const _hoisted_1$2 = { class: "render-form-container" };
const _hoisted_2$2 = { key: 0 };
const _hoisted_3$1 = { key: 0 };
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
  var _a2, _b, _c, _d;
  const _component_van_form = resolveComponent("van-form");
  const _component_van_config_provider = resolveComponent("van-config-provider");
  const _component_el_form = resolveComponent("el-form");
  return openBlock(), createElementBlock("div", _hoisted_1$2, [
    $props.h5 ? (openBlock(), createBlock(_component_van_config_provider, {
      key: 0,
      "z-index": 3e3
    }, {
      default: withCtx(() => {
        var _a3, _b2, _c2, _d2, _e;
        return [
          createVNode(_component_van_form, {
            ref: "widgetFormRef",
            class: normalizeClass([{ detail: $props.detail }]),
            "label-align": $props.jsonObject.formConfig && ((_a3 = $props.jsonObject.formConfig.h5) == null ? void 0 : _a3.labelPosition) || "left",
            "input-align": $props.jsonObject.formConfig && ((_b2 = $props.jsonObject.formConfig.h5) == null ? void 0 : _b2.labelPosition) === "top" ? "left" : ((_c2 = $props.jsonObject.formConfig.h5) == null ? void 0 : _c2.inputAlign) || "right",
            "label-width": $props.jsonObject.formConfig && ((_d2 = $props.jsonObject.formConfig.h5) == null ? void 0 : _d2.labelPosition) === "top" ? "100%" : $props.jsonObject.formConfig && ((_e = $props.jsonObject.formConfig.h5) == null ? void 0 : _e.labelWidth) || "80px",
            "validate-first": "",
            "scroll-to-error": "",
            "show-error": ""
          }, {
            default: withCtx(() => [
              createElementVNode("div", null, [
                (openBlock(true), createElementBlock(Fragment, null, renderList($setup.widgetList, (widget, index) => {
                  return openBlock(), createElementBlock(Fragment, { key: index }, [
                    widget.type === "correlation" && widget.permission < 2 ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
                      (openBlock(), createBlock(resolveDynamicComponent(`m-${widget.type}`), {
                        modelValue: $setup.formModel[widget.options.name],
                        "onUpdate:modelValue": ($event) => $setup.formModel[widget.options.name] = $event,
                        "form-data": $setup.formModel,
                        "widget-list": $props.jsonObject.widgetList,
                        item: widget,
                        index,
                        h5: true,
                        detail: $props.detail
                      }, createSlots({ _: 2 }, [
                        _ctx.$slots.correlation ? {
                          name: "default",
                          fn: withCtx(({ item, remove }) => [
                            renderSlot(_ctx.$slots, "correlation", {
                              item,
                              remove
                            })
                          ]),
                          key: "0"
                        } : void 0,
                        _ctx.$slots.correlationDialog ? {
                          name: "dialog",
                          fn: withCtx(({ options: options2, callback, save }) => [
                            renderSlot(_ctx.$slots, "correlationDialog", {
                              options: options2,
                              callback,
                              save
                            })
                          ]),
                          key: "1"
                        } : void 0
                      ]), 1032, ["modelValue", "onUpdate:modelValue", "form-data", "widget-list", "item", "index", "detail"]))
                    ])) : widget.permission < 2 ? (openBlock(), createBlock(resolveDynamicComponent(`m-${widget.type}`), {
                      key: 1,
                      modelValue: $setup.formModel[widget.options.name],
                      "onUpdate:modelValue": ($event) => $setup.formModel[widget.options.name] = $event,
                      "form-data": $setup.formModel,
                      "widget-list": $props.jsonObject.widgetList,
                      item: widget,
                      index,
                      h5: true,
                      detail: $props.detail
                    }, null, 8, ["modelValue", "onUpdate:modelValue", "form-data", "widget-list", "item", "index", "detail"])) : createCommentVNode("", true)
                  ], 64);
                }), 128))
              ])
            ]),
            _: 3
          }, 8, ["class", "label-align", "input-align", "label-width"])
        ];
      }),
      _: 3
    })) : (openBlock(), createBlock(_component_el_form, {
      key: 1,
      ref: "widgetFormRef",
      class: normalizeClass(["ep-form-widget-list flex", [{ detail: $props.detail }]]),
      model: $setup.formModel,
      "validate-on-rule-change": false,
      "hide-required-asterisk": false,
      "label-position": $props.jsonObject.formConfig && ((_a2 = $props.jsonObject.formConfig.pc) == null ? void 0 : _a2.labelPosition) || "left",
      "label-width": $props.jsonObject.formConfig && ((_b = $props.jsonObject.formConfig.pc) == null ? void 0 : _b.labelPosition) === "top" ? "100%" : $props.jsonObject.formConfig && ((_c = $props.jsonObject.formConfig.pc) == null ? void 0 : _c.labelWidth) || "100px",
      size: $props.jsonObject.formConfig && ((_d = $props.jsonObject.formConfig.pc) == null ? void 0 : _d.size) || "default"
    }, {
      default: withCtx(() => [
        (openBlock(true), createElementBlock(Fragment, null, renderList($setup.widgetList, (widget, index) => {
          return openBlock(), createElementBlock("div", {
            key: index,
            style: { "width": "100%" }
          }, [
            widget.type === "correlation" && widget.permission < 2 ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
              (openBlock(), createBlock(resolveDynamicComponent(`m-${widget.type}`), {
                modelValue: $setup.formModel[widget.options.name],
                "onUpdate:modelValue": ($event) => $setup.formModel[widget.options.name] = $event,
                "form-data": $setup.formModel,
                "widget-list": $props.jsonObject.widgetList,
                item: widget,
                index,
                detail: $props.detail
              }, createSlots({ _: 2 }, [
                _ctx.$slots.correlation ? {
                  name: "default",
                  fn: withCtx(({ item, remove }) => [
                    renderSlot(_ctx.$slots, "correlation", {
                      item,
                      remove
                    })
                  ]),
                  key: "0"
                } : void 0,
                _ctx.$slots.correlationDialog ? {
                  name: "dialog",
                  fn: withCtx(({ options: options2, callback }) => [
                    renderSlot(_ctx.$slots, "correlationDialog", {
                      options: options2,
                      callback
                    })
                  ]),
                  key: "1"
                } : void 0
              ]), 1032, ["modelValue", "onUpdate:modelValue", "form-data", "widget-list", "item", "index", "detail"]))
            ])) : widget.permission < 2 ? (openBlock(), createBlock(resolveDynamicComponent(`m-${widget.type}`), {
              key: 1,
              modelValue: $setup.formModel[widget.options.name],
              "onUpdate:modelValue": ($event) => $setup.formModel[widget.options.name] = $event,
              "form-data": $setup.formModel,
              "widget-list": $props.jsonObject.widgetList,
              item: widget,
              index,
              detail: $props.detail
            }, null, 8, ["modelValue", "onUpdate:modelValue", "form-data", "widget-list", "item", "index", "detail"])) : createCommentVNode("", true)
          ]);
        }), 128))
      ]),
      _: 3
    }, 8, ["class", "model", "label-position", "label-width", "size"]))
  ]);
}
const RenderForm = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1]]);
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
const freeGlobal$1 = freeGlobal;
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
var root = freeGlobal$1 || freeSelf || Function("return this")();
const root$1 = root;
var Symbol$1 = root$1.Symbol;
const Symbol$2 = Symbol$1;
var objectProto$1 = Object.prototype;
var hasOwnProperty = objectProto$1.hasOwnProperty;
var nativeObjectToString$1 = objectProto$1.toString;
var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0;
function getRawTag(value) {
  var isOwn = hasOwnProperty.call(value, symToStringTag$1), tag = value[symToStringTag$1];
  try {
    value[symToStringTag$1] = void 0;
    var unmasked = true;
  } catch (e) {
  }
  var result = nativeObjectToString$1.call(value);
  if (unmasked) {
    if (isOwn) {
      value[symToStringTag$1] = tag;
    } else {
      delete value[symToStringTag$1];
    }
  }
  return result;
}
var objectProto = Object.prototype;
var nativeObjectToString = objectProto.toString;
function objectToString$1(value) {
  return nativeObjectToString.call(value);
}
var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : void 0;
function baseGetTag(value) {
  if (value == null) {
    return value === void 0 ? undefinedTag : nullTag;
  }
  return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString$1(value);
}
function isObjectLike(value) {
  return value != null && typeof value == "object";
}
var symbolTag = "[object Symbol]";
function isSymbol$1(value) {
  return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
}
var reWhitespace = /\s/;
function trimmedEndIndex(string) {
  var index = string.length;
  while (index-- && reWhitespace.test(string.charAt(index))) {
  }
  return index;
}
var reTrimStart = /^\s+/;
function baseTrim(string) {
  return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
}
function isObject(value) {
  var type2 = typeof value;
  return value != null && (type2 == "object" || type2 == "function");
}
var NAN = 0 / 0;
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
var reIsBinary = /^0b[01]+$/i;
var reIsOctal = /^0o[0-7]+$/i;
var freeParseInt = parseInt;
function toNumber(value) {
  if (typeof value == "number") {
    return value;
  }
  if (isSymbol$1(value)) {
    return NAN;
  }
  if (isObject(value)) {
    var other = typeof value.valueOf == "function" ? value.valueOf() : value;
    value = isObject(other) ? other + "" : other;
  }
  if (typeof value != "string") {
    return value === 0 ? value : +value;
  }
  value = baseTrim(value);
  var isBinary = reIsBinary.test(value);
  return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
}
var now = function() {
  return root$1.Date.now();
};
const now$1 = now;
var FUNC_ERROR_TEXT$1 = "Expected a function";
var nativeMax = Math.max, nativeMin = Math.min;
function debounce(func, wait, options2) {
  var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
  if (typeof func != "function") {
    throw new TypeError(FUNC_ERROR_TEXT$1);
  }
  wait = toNumber(wait) || 0;
  if (isObject(options2)) {
    leading = !!options2.leading;
    maxing = "maxWait" in options2;
    maxWait = maxing ? nativeMax(toNumber(options2.maxWait) || 0, wait) : maxWait;
    trailing = "trailing" in options2 ? !!options2.trailing : trailing;
  }
  function invokeFunc(time) {
    var args = lastArgs, thisArg = lastThis;
    lastArgs = lastThis = void 0;
    lastInvokeTime = time;
    result = func.apply(thisArg, args);
    return result;
  }
  function leadingEdge(time) {
    lastInvokeTime = time;
    timerId = setTimeout(timerExpired, wait);
    return leading ? invokeFunc(time) : result;
  }
  function remainingWait(time) {
    var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
    return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
  }
  function shouldInvoke(time) {
    var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
    return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
  }
  function timerExpired() {
    var time = now$1();
    if (shouldInvoke(time)) {
      return trailingEdge(time);
    }
    timerId = setTimeout(timerExpired, remainingWait(time));
  }
  function trailingEdge(time) {
    timerId = void 0;
    if (trailing && lastArgs) {
      return invokeFunc(time);
    }
    lastArgs = lastThis = void 0;
    return result;
  }
  function cancel() {
    if (timerId !== void 0) {
      clearTimeout(timerId);
    }
    lastInvokeTime = 0;
    lastArgs = lastCallTime = lastThis = timerId = void 0;
  }
  function flush() {
    return timerId === void 0 ? result : trailingEdge(now$1());
  }
  function debounced() {
    var time = now$1(), isInvoking = shouldInvoke(time);
    lastArgs = arguments;
    lastThis = this;
    lastCallTime = time;
    if (isInvoking) {
      if (timerId === void 0) {
        return leadingEdge(lastCallTime);
      }
      if (maxing) {
        clearTimeout(timerId);
        timerId = setTimeout(timerExpired, wait);
        return invokeFunc(lastCallTime);
      }
    }
    if (timerId === void 0) {
      timerId = setTimeout(timerExpired, wait);
    }
    return result;
  }
  debounced.cancel = cancel;
  debounced.flush = flush;
  return debounced;
}
var FUNC_ERROR_TEXT = "Expected a function";
function throttle(func, wait, options2) {
  var leading = true, trailing = true;
  if (typeof func != "function") {
    throw new TypeError(FUNC_ERROR_TEXT);
  }
  if (isObject(options2)) {
    leading = "leading" in options2 ? !!options2.leading : leading;
    trailing = "trailing" in options2 ? !!options2.trailing : trailing;
  }
  return debounce(func, wait, {
    "leading": leading,
    "maxWait": wait,
    "trailing": trailing
  });
}
var _a;
const isClient = typeof window !== "undefined";
const isString$1 = (val) => typeof val === "string";
const noop = () => {
};
isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
function resolveUnref(r) {
  return typeof r === "function" ? r() : unref(r);
}
function identity(arg) {
  return arg;
}
function tryOnScopeDispose(fn) {
  if (getCurrentScope()) {
    onScopeDispose(fn);
    return true;
  }
  return false;
}
function unrefElement(elRef) {
  var _a2;
  const plain = resolveUnref(elRef);
  return (_a2 = plain == null ? void 0 : plain.$el) != null ? _a2 : plain;
}
const defaultWindow = isClient ? window : void 0;
function useEventListener(...args) {
  let target;
  let events;
  let listeners;
  let options2;
  if (isString$1(args[0]) || Array.isArray(args[0])) {
    [events, listeners, options2] = args;
    target = defaultWindow;
  } else {
    [target, events, listeners, options2] = args;
  }
  if (!target)
    return noop;
  if (!Array.isArray(events))
    events = [events];
  if (!Array.isArray(listeners))
    listeners = [listeners];
  const cleanups = [];
  const cleanup = () => {
    cleanups.forEach((fn) => fn());
    cleanups.length = 0;
  };
  const register = (el, event, listener, options22) => {
    el.addEventListener(event, listener, options22);
    return () => el.removeEventListener(event, listener, options22);
  };
  const stopWatch = watch(() => [unrefElement(target), resolveUnref(options2)], ([el, options22]) => {
    cleanup();
    if (!el)
      return;
    cleanups.push(...events.flatMap((event) => {
      return listeners.map((listener) => register(el, event, listener, options22));
    }));
  }, { immediate: true, flush: "post" });
  const stop = () => {
    stopWatch();
    cleanup();
  };
  tryOnScopeDispose(stop);
  return stop;
}
const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
const globalKey = "__vueuse_ssr_handlers__";
_global[globalKey] = _global[globalKey] || {};
var SwipeDirection;
(function(SwipeDirection2) {
  SwipeDirection2["UP"] = "UP";
  SwipeDirection2["RIGHT"] = "RIGHT";
  SwipeDirection2["DOWN"] = "DOWN";
  SwipeDirection2["LEFT"] = "LEFT";
  SwipeDirection2["NONE"] = "NONE";
})(SwipeDirection || (SwipeDirection = {}));
var __defProp = Object.defineProperty;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
  for (var prop in b || (b = {}))
    if (__hasOwnProp.call(b, prop))
      __defNormalProp(a, prop, b[prop]);
  if (__getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(b)) {
      if (__propIsEnum.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    }
  return a;
};
const _TransitionPresets = {
  easeInSine: [0.12, 0, 0.39, 0],
  easeOutSine: [0.61, 1, 0.88, 1],
  easeInOutSine: [0.37, 0, 0.63, 1],
  easeInQuad: [0.11, 0, 0.5, 0],
  easeOutQuad: [0.5, 1, 0.89, 1],
  easeInOutQuad: [0.45, 0, 0.55, 1],
  easeInCubic: [0.32, 0, 0.67, 0],
  easeOutCubic: [0.33, 1, 0.68, 1],
  easeInOutCubic: [0.65, 0, 0.35, 1],
  easeInQuart: [0.5, 0, 0.75, 0],
  easeOutQuart: [0.25, 1, 0.5, 1],
  easeInOutQuart: [0.76, 0, 0.24, 1],
  easeInQuint: [0.64, 0, 0.78, 0],
  easeOutQuint: [0.22, 1, 0.36, 1],
  easeInOutQuint: [0.83, 0, 0.17, 1],
  easeInExpo: [0.7, 0, 0.84, 0],
  easeOutExpo: [0.16, 1, 0.3, 1],
  easeInOutExpo: [0.87, 0, 0.13, 1],
  easeInCirc: [0.55, 0, 1, 0.45],
  easeOutCirc: [0, 0.55, 0.45, 1],
  easeInOutCirc: [0.85, 0, 0.15, 1],
  easeInBack: [0.36, 0, 0.66, -0.56],
  easeOutBack: [0.34, 1.56, 0.64, 1],
  easeInOutBack: [0.68, -0.6, 0.32, 1.6]
};
__spreadValues({
  linear: identity
}, _TransitionPresets);
const index_vue_vue_type_style_index_0_scoped_5eb771c9_lang = "";
const _hoisted_1$1 = { class: "el-image-viewer__btn el-image-viewer__actions" };
const _hoisted_2$1 = { class: "el-image-viewer__actions__inner" };
const _hoisted_3 = { class: "el-image-viewer__canvas" };
const _hoisted_4 = ["src"];
const _sfc_main$1 = {
  __name: "index",
  props: {
    /** 用于预览的图片链接列表 */
    urlList: {
      type: Array,
      default: () => []
    },
    /** 预览时遮罩层的 z-index */
    zIndex: {
      type: Number,
      default: null
    },
    /** 初始预览图像索引，小于 url-list 的长度 */
    initialIndex: {
      type: Number,
      default: 0
    },
    /** 是否可以无限循环预览 */
    infinite: {
      type: Boolean,
      default: true
    },
    /** 是否可以通过点击遮罩层关闭 */
    hideOnClickModal: {
      type: Boolean,
      default: false
    },
    /** image-viewer 是否插入至 body 元素上 */
    teleported: {
      type: Boolean,
      default: false
    },
    /** 是否可以通过按下 ESC 关闭 Image Viewer */
    closeOnPressEscape: {
      type: Boolean,
      default: true
    },
    zoomRate: {
      type: Number,
      default: 1.2
    }
  },
  emits: ["close", "switch"],
  setup(__props, { emit: __emit }) {
    const props2 = __props;
    const emit = __emit;
    const scopeEventListener = effectScope();
    const isSingle = computed(() => {
      const { urlList } = props2;
      return urlList.length <= 1;
    });
    const modes = {
      CONTAIN: {
        name: "contain"
      },
      ORIGINAL: {
        name: "original"
      }
    };
    const EVENT_CODE = {
      tab: "Tab",
      enter: "Enter",
      space: "Space",
      left: "ArrowLeft",
      // 37
      up: "ArrowUp",
      // 38
      right: "ArrowRight",
      // 39
      down: "ArrowDown",
      // 40
      esc: "Escape",
      delete: "Delete",
      backspace: "Backspace",
      numpadEnter: "NumpadEnter",
      pageUp: "PageUp",
      pageDown: "PageDown",
      home: "Home",
      end: "End"
    };
    const wrapper = ref$1();
    const imgRefs = ref$1([]);
    const loading = ref$1(true);
    const activeIndex = ref$1(props2.initialIndex);
    const mode = shallowRef(modes.CONTAIN);
    const transform = ref$1({
      scale: 1,
      deg: 0,
      offsetX: 0,
      offsetY: 0,
      enableTransition: false
    });
    const isFirst = computed(() => {
      return activeIndex.value === 0;
    });
    const isLast = computed(() => {
      return activeIndex.value === props2.urlList.length - 1;
    });
    const currentImg = computed(() => {
      return props2.urlList[activeIndex.value];
    });
    const imgStyle = computed(() => {
      const { scale, deg, offsetX, offsetY, enableTransition } = transform.value;
      let translateX = offsetX / scale;
      let translateY = offsetY / scale;
      switch (deg % 360) {
        case 90:
        case -270:
          [translateX, translateY] = [translateY, -translateX];
          break;
        case 180:
        case -180:
          [translateX, translateY] = [-translateX, -translateY];
          break;
        case 270:
        case -90:
          [translateX, translateY] = [-translateY, translateX];
          break;
      }
      const style = {
        transform: `scale(${scale}) rotate(${deg}deg) translate(${translateX}px, ${translateY}px)`,
        transition: enableTransition ? "transform .3s" : ""
      };
      if (mode.value.name === modes.CONTAIN.name) {
        style.maxWidth = style.maxHeight = "100%";
      }
      return style;
    });
    const computedZIndex = computed(() => {
      return typeof props2.zIndex === "number" ? props2.zIndex : 9999;
    });
    function hide() {
      unregisterEventListener();
      emit("close");
    }
    function registerEventListener() {
      const keydownHandler = throttle((e) => {
        switch (e.code) {
          case EVENT_CODE.esc:
            props2.closeOnPressEscape && hide();
            break;
          case EVENT_CODE.space:
            toggleMode();
            break;
          case EVENT_CODE.left:
            prev();
            break;
          case EVENT_CODE.up:
            handleActions("zoomIn");
            break;
          case EVENT_CODE.right:
            next();
            break;
          case EVENT_CODE.down:
            handleActions("zoomOut");
            break;
        }
      });
      const mousewheelHandler = throttle((e) => {
        const delta = e.deltaY || e.deltaX;
        handleActions(delta < 0 ? "zoomIn" : "zoomOut", {
          zoomRate: props2.zoomRate,
          enableTransition: false
        });
      });
      scopeEventListener.run(() => {
        useEventListener(document, "keydown", keydownHandler);
        useEventListener(document, "wheel", mousewheelHandler);
      });
    }
    function unregisterEventListener() {
      scopeEventListener.stop();
    }
    function handleImgLoad() {
      loading.value = false;
    }
    function handleImgError(e) {
      loading.value = false;
      e.target.alt = "图片加载失败..";
    }
    function handleMouseDown(e) {
      if (loading.value || e.button !== 0 || !wrapper.value)
        return;
      transform.value.enableTransition = false;
      const { offsetX, offsetY } = transform.value;
      const startX = e.pageX;
      const startY = e.pageY;
      const dragHandler = throttle((ev) => {
        transform.value = {
          ...transform.value,
          offsetX: offsetX + ev.pageX - startX,
          offsetY: offsetY + ev.pageY - startY
        };
      });
      const removeMousemove = useEventListener(document, "mousemove", dragHandler);
      useEventListener(document, "mouseup", () => {
        removeMousemove();
      });
      e.preventDefault();
    }
    function reset() {
      transform.value = {
        scale: 1,
        deg: 0,
        offsetX: 0,
        offsetY: 0,
        enableTransition: false
      };
    }
    function toggleMode() {
      if (loading.value)
        return;
      const modeNames = Object.keys(modes);
      const modeValues = Object.values(modes);
      const currentMode = mode.value.name;
      const index = modeValues.findIndex((i) => i.name === currentMode);
      const nextIndex = (index + 1) % modeNames.length;
      mode.value = modes[modeNames[nextIndex]];
      reset();
    }
    function setActiveItem(index) {
      const len = props2.urlList.length;
      activeIndex.value = (index + len) % len;
    }
    function prev() {
      if (isFirst.value && !props2.infinite)
        return;
      setActiveItem(activeIndex.value - 1);
    }
    function next() {
      if (isLast.value && !props2.infinite)
        return;
      setActiveItem(activeIndex.value + 1);
    }
    function handleActions(action, options2 = {}) {
      if (loading.value)
        return;
      const { zoomRate, rotateDeg, enableTransition } = {
        zoomRate: props2.zoomRate,
        rotateDeg: 90,
        enableTransition: true,
        ...options2
      };
      switch (action) {
        case "zoomOut":
          if (transform.value.scale > 0.2) {
            transform.value.scale = Number.parseFloat((transform.value.scale / zoomRate).toFixed(3));
          }
          break;
        case "zoomIn":
          if (transform.value.scale < 7) {
            transform.value.scale = Number.parseFloat((transform.value.scale * zoomRate).toFixed(3));
          }
          break;
        case "clockwise":
          transform.value.deg += rotateDeg;
          break;
        case "anticlockwise":
          transform.value.deg -= rotateDeg;
          break;
        case "download":
          downloadByBlob(currentImg.value, "download");
          break;
      }
      transform.value.enableTransition = enableTransition;
    }
    watch(currentImg, () => {
      nextTick(() => {
        const $img = imgRefs.value[0];
        if (!($img == null ? void 0 : $img.complete)) {
          loading.value = true;
        }
      });
    });
    watch(activeIndex, (val) => {
      reset();
      emit("switch", val);
    });
    onMounted(() => {
      var _a2, _b;
      registerEventListener();
      (_b = (_a2 = wrapper.value) == null ? void 0 : _a2.focus) == null ? void 0 : _b.call(_a2);
    });
    return (_ctx, _cache) => {
      const _component_Close = resolveComponent("Close");
      const _component_el_icon = resolveComponent("el-icon");
      const _component_ArrowLeft = resolveComponent("ArrowLeft");
      const _component_ArrowRight = resolveComponent("ArrowRight");
      const _component_ZoomOut = resolveComponent("ZoomOut");
      const _component_ZoomIn = resolveComponent("ZoomIn");
      const _component_FullScreen = resolveComponent("FullScreen");
      const _component_ScaleToOriginal = resolveComponent("ScaleToOriginal");
      const _component_Download = resolveComponent("Download");
      const _component_RefreshLeft = resolveComponent("RefreshLeft");
      const _component_RefreshRight = resolveComponent("RefreshRight");
      return openBlock(), createBlock(Teleport, {
        to: "body",
        disabled: !__props.teleported
      }, [
        createVNode(Transition, {
          name: "viewer-fade",
          appear: ""
        }, {
          default: withCtx(() => [
            createElementVNode("div", {
              ref_key: "wrapper",
              ref: wrapper,
              tabindex: -1,
              class: "el-image-viewer__wrapper",
              style: normalizeStyle({ zIndex: computedZIndex.value })
            }, [
              createElementVNode("div", {
                class: "el-image-viewer__mask",
                onClick: _cache[0] || (_cache[0] = withModifiers(($event) => __props.hideOnClickModal && hide(), ["self"]))
              }),
              createElementVNode("span", {
                class: "el-image-viewer__btn el-image-viewer__close",
                onClick: hide
              }, [
                createVNode(_component_el_icon, null, {
                  default: withCtx(() => [
                    createVNode(_component_Close)
                  ]),
                  _: 1
                })
              ]),
              !isSingle.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
                createElementVNode("span", {
                  class: normalizeClass([
                    "el-image-viewer__btn",
                    "el-image-viewer__prev",
                    { "el-image-viewer__disabled": !__props.infinite && isFirst.value }
                  ]),
                  onClick: prev
                }, [
                  createVNode(_component_el_icon, null, {
                    default: withCtx(() => [
                      createVNode(_component_ArrowLeft)
                    ]),
                    _: 1
                  })
                ], 2),
                createElementVNode("span", {
                  class: normalizeClass([
                    "el-image-viewer__btn",
                    "el-image-viewer__next",
                    { "el-image-viewer__disabled": !__props.infinite && isLast.value }
                  ]),
                  onClick: next
                }, [
                  createVNode(_component_el_icon, null, {
                    default: withCtx(() => [
                      createVNode(_component_ArrowRight)
                    ]),
                    _: 1
                  })
                ], 2)
              ], 64)) : createCommentVNode("", true),
              createElementVNode("div", _hoisted_1$1, [
                createElementVNode("div", _hoisted_2$1, [
                  createVNode(_component_el_icon, {
                    onClick: _cache[1] || (_cache[1] = ($event) => handleActions("zoomOut"))
                  }, {
                    default: withCtx(() => [
                      createVNode(_component_ZoomOut)
                    ]),
                    _: 1
                  }),
                  createVNode(_component_el_icon, {
                    onClick: _cache[2] || (_cache[2] = ($event) => handleActions("zoomIn"))
                  }, {
                    default: withCtx(() => [
                      createVNode(_component_ZoomIn)
                    ]),
                    _: 1
                  }),
                  _cache[6] || (_cache[6] = createElementVNode("i", { class: "el-image-viewer__actions__divider" }, null, -1)),
                  createVNode(_component_el_icon, { onClick: toggleMode }, {
                    default: withCtx(() => [
                      withDirectives(createVNode(_component_FullScreen, null, null, 512), [
                        [vShow, mode.value.name === "contain"]
                      ]),
                      withDirectives(createVNode(_component_ScaleToOriginal, null, null, 512), [
                        [vShow, mode.value.name === "original"]
                      ])
                    ]),
                    _: 1
                  }),
                  createVNode(_component_el_icon, {
                    onClick: _cache[3] || (_cache[3] = ($event) => handleActions("download"))
                  }, {
                    default: withCtx(() => [
                      createVNode(_component_Download)
                    ]),
                    _: 1
                  }),
                  _cache[7] || (_cache[7] = createElementVNode("i", { class: "el-image-viewer__actions__divider" }, null, -1)),
                  createVNode(_component_el_icon, {
                    onClick: _cache[4] || (_cache[4] = ($event) => handleActions("anticlockwise"))
                  }, {
                    default: withCtx(() => [
                      createVNode(_component_RefreshLeft)
                    ]),
                    _: 1
                  }),
                  createVNode(_component_el_icon, {
                    onClick: _cache[5] || (_cache[5] = ($event) => handleActions("clockwise"))
                  }, {
                    default: withCtx(() => [
                      createVNode(_component_RefreshRight)
                    ]),
                    _: 1
                  })
                ])
              ]),
              createElementVNode("div", _hoisted_3, [
                (openBlock(true), createElementBlock(Fragment, null, renderList(__props.urlList, (url, i) => {
                  return withDirectives((openBlock(), createElementBlock("img", {
                    ref_for: true,
                    ref: (el) => imgRefs.value[i] = el,
                    key: url,
                    src: url,
                    style: normalizeStyle(imgStyle.value),
                    class: "el-image-viewer__img",
                    onLoad: handleImgLoad,
                    onError: handleImgError,
                    onMousedown: handleMouseDown
                  }, null, 44, _hoisted_4)), [
                    [vShow, i === activeIndex.value]
                  ]);
                }), 128))
              ])
            ], 4)
          ]),
          _: 1
        })
      ], 8, ["disabled"]);
    };
  }
};
const ImageViewer = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-5eb771c9"]]);
const index_vue_vue_type_style_index_0_scoped_373f2614_lang = "";
const _sfc_main = {
  props: {
    prefix: {
      type: String,
      default: "m-icon"
    },
    name: {
      type: String,
      required: true
    }
  },
  setup(props2) {
    const symbolId = computed(() => `#${props2.prefix}-${props2.name}`);
    return {
      symbolId
    };
  }
};
const _hoisted_1 = {
  class: "svg-icon",
  "aria-hidden": "true"
};
const _hoisted_2 = ["xlink:href"];
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createElementBlock("svg", _hoisted_1, [
    createElementVNode("use", { "xlink:href": $setup.symbolId }, null, 8, _hoisted_2)
  ]);
}
const SvgIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-373f2614"]]);
const components = [
  { name: "CodeEditor", component: CodeEditor },
  { name: "CodeEditorFormula", component: CodeEditorFormula },
  { name: "EpFormMaking", component: Designer },
  { name: "VanFormMaking", component: DesignerMobile },
  { name: "DetailForm", component: DetailForm },
  { name: "ImageViewer", component: ImageViewer },
  { name: "RenderForm", component: RenderForm },
  { name: "SettingPanel", component: SettingPanel },
  { name: "WidgetForm", component: WidgetForm },
  { name: "WidgetFormItem", component: WidgetFormItem },
  { name: "WidgetPanel", component: WidgetPanel },
  { name: "MIcon", component: SvgIcon }
];
const components$1 = (App) => {
  components.forEach((m) => {
    App.component(m.name, m.component);
  });
  Object.keys(fields).forEach((name) => {
    App.component(name, fields[name]);
  });
};
const duration = 2500;
const useMessage = () => {
  const message = (message2, type2, onClose) => {
    return ElMessage({
      message: message2,
      type: type2,
      showClose: true,
      duration,
      onClose
    });
  };
  const success = (msg, onClose) => {
    return message(msg, "success", onClose);
  };
  const warning = (msg, onClose) => {
    return message(msg, "warning", onClose);
  };
  const error = (msg, onClose) => {
    return message(msg, "error", onClose);
  };
  const confirm = (msg, title, options2) => {
    return ElMessageBox.confirm(
      msg,
      title || "警告",
      Object.assign(
        {
          confirmButtonText: "确认",
          cancelButtonText: "取消",
          type: "warning"
        },
        options2
      )
    );
  };
  return { success, warning, error, confirm };
};
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
function getDefaultExportFromCjs(x) {
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
}
function getAugmentedNamespace(n) {
  if (n.__esModule)
    return n;
  var f = n.default;
  if (typeof f == "function") {
    var a = function a2() {
      if (this instanceof a2) {
        return Reflect.construct(f, arguments, this.constructor);
      }
      return f.apply(this, arguments);
    };
    a.prototype = f.prototype;
  } else
    a = {};
  Object.defineProperty(a, "__esModule", { value: true });
  Object.keys(n).forEach(function(k) {
    var d = Object.getOwnPropertyDescriptor(n, k);
    Object.defineProperty(a, k, d.get ? d : {
      enumerable: true,
      get: function() {
        return n[k];
      }
    });
  });
  return a;
}
var combineURLs = function combineURLs2(baseURL, relativeURL) {
  return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
};
const combineURLs$1 = /* @__PURE__ */ getDefaultExportFromCjs(combineURLs);
var type = TypeError;
const __viteBrowserExternal = {};
const __viteBrowserExternal$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: __viteBrowserExternal
}, Symbol.toStringTag, { value: "Module" }));
const require$$0 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1);
var hasMap = typeof Map === "function" && Map.prototype;
var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null;
var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === "function" ? mapSizeDescriptor.get : null;
var mapForEach = hasMap && Map.prototype.forEach;
var hasSet = typeof Set === "function" && Set.prototype;
var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null;
var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === "function" ? setSizeDescriptor.get : null;
var setForEach = hasSet && Set.prototype.forEach;
var hasWeakMap = typeof WeakMap === "function" && WeakMap.prototype;
var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
var hasWeakSet = typeof WeakSet === "function" && WeakSet.prototype;
var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
var hasWeakRef = typeof WeakRef === "function" && WeakRef.prototype;
var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
var booleanValueOf = Boolean.prototype.valueOf;
var objectToString = Object.prototype.toString;
var functionToString = Function.prototype.toString;
var $match = String.prototype.match;
var $slice = String.prototype.slice;
var $replace$1 = String.prototype.replace;
var $toUpperCase = String.prototype.toUpperCase;
var $toLowerCase = String.prototype.toLowerCase;
var $test = RegExp.prototype.test;
var $concat$1 = Array.prototype.concat;
var $join = Array.prototype.join;
var $arrSlice = Array.prototype.slice;
var $floor = Math.floor;
var bigIntValueOf = typeof BigInt === "function" ? BigInt.prototype.valueOf : null;
var gOPS = Object.getOwnPropertySymbols;
var symToString = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? Symbol.prototype.toString : null;
var hasShammedSymbols = typeof Symbol === "function" && typeof Symbol.iterator === "object";
var toStringTag = typeof Symbol === "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? "object" : "symbol") ? Symbol.toStringTag : null;
var isEnumerable = Object.prototype.propertyIsEnumerable;
var gPO = (typeof Reflect === "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(O) {
  return O.__proto__;
} : null);
function addNumericSeparator(num, str) {
  if (num === Infinity || num === -Infinity || num !== num || num && num > -1e3 && num < 1e3 || $test.call(/e/, str)) {
    return str;
  }
  var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
  if (typeof num === "number") {
    var int = num < 0 ? -$floor(-num) : $floor(num);
    if (int !== num) {
      var intStr = String(int);
      var dec = $slice.call(str, intStr.length + 1);
      return $replace$1.call(intStr, sepRegex, "$&_") + "." + $replace$1.call($replace$1.call(dec, /([0-9]{3})/g, "$&_"), /_$/, "");
    }
  }
  return $replace$1.call(str, sepRegex, "$&_");
}
var utilInspect = require$$0;
var inspectCustom = utilInspect.custom;
var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
var quotes = {
  __proto__: null,
  "double": '"',
  single: "'"
};
var quoteREs = {
  __proto__: null,
  "double": /(["\\])/g,
  single: /(['\\])/g
};
var objectInspect = function inspect_(obj, options2, depth, seen) {
  var opts = options2 || {};
  if (has$3(opts, "quoteStyle") && !has$3(quotes, opts.quoteStyle)) {
    throw new TypeError('option "quoteStyle" must be "single" or "double"');
  }
  if (has$3(opts, "maxStringLength") && (typeof opts.maxStringLength === "number" ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity : opts.maxStringLength !== null)) {
    throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
  }
  var customInspect = has$3(opts, "customInspect") ? opts.customInspect : true;
  if (typeof customInspect !== "boolean" && customInspect !== "symbol") {
    throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
  }
  if (has$3(opts, "indent") && opts.indent !== null && opts.indent !== "	" && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)) {
    throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
  }
  if (has$3(opts, "numericSeparator") && typeof opts.numericSeparator !== "boolean") {
    throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
  }
  var numericSeparator = opts.numericSeparator;
  if (typeof obj === "undefined") {
    return "undefined";
  }
  if (obj === null) {
    return "null";
  }
  if (typeof obj === "boolean") {
    return obj ? "true" : "false";
  }
  if (typeof obj === "string") {
    return inspectString(obj, opts);
  }
  if (typeof obj === "number") {
    if (obj === 0) {
      return Infinity / obj > 0 ? "0" : "-0";
    }
    var str = String(obj);
    return numericSeparator ? addNumericSeparator(obj, str) : str;
  }
  if (typeof obj === "bigint") {
    var bigIntStr = String(obj) + "n";
    return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
  }
  var maxDepth = typeof opts.depth === "undefined" ? 5 : opts.depth;
  if (typeof depth === "undefined") {
    depth = 0;
  }
  if (depth >= maxDepth && maxDepth > 0 && typeof obj === "object") {
    return isArray$3(obj) ? "[Array]" : "[Object]";
  }
  var indent = getIndent(opts, depth);
  if (typeof seen === "undefined") {
    seen = [];
  } else if (indexOf(seen, obj) >= 0) {
    return "[Circular]";
  }
  function inspect2(value, from, noIndent) {
    if (from) {
      seen = $arrSlice.call(seen);
      seen.push(from);
    }
    if (noIndent) {
      var newOpts = {
        depth: opts.depth
      };
      if (has$3(opts, "quoteStyle")) {
        newOpts.quoteStyle = opts.quoteStyle;
      }
      return inspect_(value, newOpts, depth + 1, seen);
    }
    return inspect_(value, opts, depth + 1, seen);
  }
  if (typeof obj === "function" && !isRegExp$1(obj)) {
    var name = nameOf(obj);
    var keys = arrObjKeys(obj, inspect2);
    return "[Function" + (name ? ": " + name : " (anonymous)") + "]" + (keys.length > 0 ? " { " + $join.call(keys, ", ") + " }" : "");
  }
  if (isSymbol(obj)) {
    var symString = hasShammedSymbols ? $replace$1.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, "$1") : symToString.call(obj);
    return typeof obj === "object" && !hasShammedSymbols ? markBoxed(symString) : symString;
  }
  if (isElement(obj)) {
    var s = "<" + $toLowerCase.call(String(obj.nodeName));
    var attrs = obj.attributes || [];
    for (var i = 0; i < attrs.length; i++) {
      s += " " + attrs[i].name + "=" + wrapQuotes(quote(attrs[i].value), "double", opts);
    }
    s += ">";
    if (obj.childNodes && obj.childNodes.length) {
      s += "...";
    }
    s += "</" + $toLowerCase.call(String(obj.nodeName)) + ">";
    return s;
  }
  if (isArray$3(obj)) {
    if (obj.length === 0) {
      return "[]";
    }
    var xs = arrObjKeys(obj, inspect2);
    if (indent && !singleLineValues(xs)) {
      return "[" + indentedJoin(xs, indent) + "]";
    }
    return "[ " + $join.call(xs, ", ") + " ]";
  }
  if (isError(obj)) {
    var parts = arrObjKeys(obj, inspect2);
    if (!("cause" in Error.prototype) && "cause" in obj && !isEnumerable.call(obj, "cause")) {
      return "{ [" + String(obj) + "] " + $join.call($concat$1.call("[cause]: " + inspect2(obj.cause), parts), ", ") + " }";
    }
    if (parts.length === 0) {
      return "[" + String(obj) + "]";
    }
    return "{ [" + String(obj) + "] " + $join.call(parts, ", ") + " }";
  }
  if (typeof obj === "object" && customInspect) {
    if (inspectSymbol && typeof obj[inspectSymbol] === "function" && utilInspect) {
      return utilInspect(obj, { depth: maxDepth - depth });
    } else if (customInspect !== "symbol" && typeof obj.inspect === "function") {
      return obj.inspect();
    }
  }
  if (isMap(obj)) {
    var mapParts = [];
    if (mapForEach) {
      mapForEach.call(obj, function(value, key) {
        mapParts.push(inspect2(key, obj, true) + " => " + inspect2(value, obj));
      });
    }
    return collectionOf("Map", mapSize.call(obj), mapParts, indent);
  }
  if (isSet(obj)) {
    var setParts = [];
    if (setForEach) {
      setForEach.call(obj, function(value) {
        setParts.push(inspect2(value, obj));
      });
    }
    return collectionOf("Set", setSize.call(obj), setParts, indent);
  }
  if (isWeakMap(obj)) {
    return weakCollectionOf("WeakMap");
  }
  if (isWeakSet(obj)) {
    return weakCollectionOf("WeakSet");
  }
  if (isWeakRef(obj)) {
    return weakCollectionOf("WeakRef");
  }
  if (isNumber(obj)) {
    return markBoxed(inspect2(Number(obj)));
  }
  if (isBigInt(obj)) {
    return markBoxed(inspect2(bigIntValueOf.call(obj)));
  }
  if (isBoolean(obj)) {
    return markBoxed(booleanValueOf.call(obj));
  }
  if (isString(obj)) {
    return markBoxed(inspect2(String(obj)));
  }
  if (typeof window !== "undefined" && obj === window) {
    return "{ [object Window] }";
  }
  if (typeof globalThis !== "undefined" && obj === globalThis || typeof commonjsGlobal !== "undefined" && obj === commonjsGlobal) {
    return "{ [object globalThis] }";
  }
  if (!isDate(obj) && !isRegExp$1(obj)) {
    var ys = arrObjKeys(obj, inspect2);
    var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
    var protoTag = obj instanceof Object ? "" : "null prototype";
    var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr$1(obj), 8, -1) : protoTag ? "Object" : "";
    var constructorTag = isPlainObject || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "";
    var tag = constructorTag + (stringTag || protoTag ? "[" + $join.call($concat$1.call([], stringTag || [], protoTag || []), ": ") + "] " : "");
    if (ys.length === 0) {
      return tag + "{}";
    }
    if (indent) {
      return tag + "{" + indentedJoin(ys, indent) + "}";
    }
    return tag + "{ " + $join.call(ys, ", ") + " }";
  }
  return String(obj);
};
function wrapQuotes(s, defaultStyle, opts) {
  var style = opts.quoteStyle || defaultStyle;
  var quoteChar = quotes[style];
  return quoteChar + s + quoteChar;
}
function quote(s) {
  return $replace$1.call(String(s), /"/g, "&quot;");
}
function canTrustToString(obj) {
  return !toStringTag || !(typeof obj === "object" && (toStringTag in obj || typeof obj[toStringTag] !== "undefined"));
}
function isArray$3(obj) {
  return toStr$1(obj) === "[object Array]" && canTrustToString(obj);
}
function isDate(obj) {
  return toStr$1(obj) === "[object Date]" && canTrustToString(obj);
}
function isRegExp$1(obj) {
  return toStr$1(obj) === "[object RegExp]" && canTrustToString(obj);
}
function isError(obj) {
  return toStr$1(obj) === "[object Error]" && canTrustToString(obj);
}
function isString(obj) {
  return toStr$1(obj) === "[object String]" && canTrustToString(obj);
}
function isNumber(obj) {
  return toStr$1(obj) === "[object Number]" && canTrustToString(obj);
}
function isBoolean(obj) {
  return toStr$1(obj) === "[object Boolean]" && canTrustToString(obj);
}
function isSymbol(obj) {
  if (hasShammedSymbols) {
    return obj && typeof obj === "object" && obj instanceof Symbol;
  }
  if (typeof obj === "symbol") {
    return true;
  }
  if (!obj || typeof obj !== "object" || !symToString) {
    return false;
  }
  try {
    symToString.call(obj);
    return true;
  } catch (e) {
  }
  return false;
}
function isBigInt(obj) {
  if (!obj || typeof obj !== "object" || !bigIntValueOf) {
    return false;
  }
  try {
    bigIntValueOf.call(obj);
    return true;
  } catch (e) {
  }
  return false;
}
var hasOwn$1 = Object.prototype.hasOwnProperty || function(key) {
  return key in this;
};
function has$3(obj, key) {
  return hasOwn$1.call(obj, key);
}
function toStr$1(obj) {
  return objectToString.call(obj);
}
function nameOf(f) {
  if (f.name) {
    return f.name;
  }
  var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
  if (m) {
    return m[1];
  }
  return null;
}
function indexOf(xs, x) {
  if (xs.indexOf) {
    return xs.indexOf(x);
  }
  for (var i = 0, l = xs.length; i < l; i++) {
    if (xs[i] === x) {
      return i;
    }
  }
  return -1;
}
function isMap(x) {
  if (!mapSize || !x || typeof x !== "object") {
    return false;
  }
  try {
    mapSize.call(x);
    try {
      setSize.call(x);
    } catch (s) {
      return true;
    }
    return x instanceof Map;
  } catch (e) {
  }
  return false;
}
function isWeakMap(x) {
  if (!weakMapHas || !x || typeof x !== "object") {
    return false;
  }
  try {
    weakMapHas.call(x, weakMapHas);
    try {
      weakSetHas.call(x, weakSetHas);
    } catch (s) {
      return true;
    }
    return x instanceof WeakMap;
  } catch (e) {
  }
  return false;
}
function isWeakRef(x) {
  if (!weakRefDeref || !x || typeof x !== "object") {
    return false;
  }
  try {
    weakRefDeref.call(x);
    return true;
  } catch (e) {
  }
  return false;
}
function isSet(x) {
  if (!setSize || !x || typeof x !== "object") {
    return false;
  }
  try {
    setSize.call(x);
    try {
      mapSize.call(x);
    } catch (m) {
      return true;
    }
    return x instanceof Set;
  } catch (e) {
  }
  return false;
}
function isWeakSet(x) {
  if (!weakSetHas || !x || typeof x !== "object") {
    return false;
  }
  try {
    weakSetHas.call(x, weakSetHas);
    try {
      weakMapHas.call(x, weakMapHas);
    } catch (s) {
      return true;
    }
    return x instanceof WeakSet;
  } catch (e) {
  }
  return false;
}
function isElement(x) {
  if (!x || typeof x !== "object") {
    return false;
  }
  if (typeof HTMLElement !== "undefined" && x instanceof HTMLElement) {
    return true;
  }
  return typeof x.nodeName === "string" && typeof x.getAttribute === "function";
}
function inspectString(str, opts) {
  if (str.length > opts.maxStringLength) {
    var remaining = str.length - opts.maxStringLength;
    var trailer = "... " + remaining + " more character" + (remaining > 1 ? "s" : "");
    return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
  }
  var quoteRE = quoteREs[opts.quoteStyle || "single"];
  quoteRE.lastIndex = 0;
  var s = $replace$1.call($replace$1.call(str, quoteRE, "\\$1"), /[\x00-\x1f]/g, lowbyte);
  return wrapQuotes(s, "single", opts);
}
function lowbyte(c) {
  var n = c.charCodeAt(0);
  var x = {
    8: "b",
    9: "t",
    10: "n",
    12: "f",
    13: "r"
  }[n];
  if (x) {
    return "\\" + x;
  }
  return "\\x" + (n < 16 ? "0" : "") + $toUpperCase.call(n.toString(16));
}
function markBoxed(str) {
  return "Object(" + str + ")";
}
function weakCollectionOf(type2) {
  return type2 + " { ? }";
}
function collectionOf(type2, size, entries, indent) {
  var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ", ");
  return type2 + " (" + size + ") {" + joinedEntries + "}";
}
function singleLineValues(xs) {
  for (var i = 0; i < xs.length; i++) {
    if (indexOf(xs[i], "\n") >= 0) {
      return false;
    }
  }
  return true;
}
function getIndent(opts, depth) {
  var baseIndent;
  if (opts.indent === "	") {
    baseIndent = "	";
  } else if (typeof opts.indent === "number" && opts.indent > 0) {
    baseIndent = $join.call(Array(opts.indent + 1), " ");
  } else {
    return null;
  }
  return {
    base: baseIndent,
    prev: $join.call(Array(depth + 1), baseIndent)
  };
}
function indentedJoin(xs, indent) {
  if (xs.length === 0) {
    return "";
  }
  var lineJoiner = "\n" + indent.prev + indent.base;
  return lineJoiner + $join.call(xs, "," + lineJoiner) + "\n" + indent.prev;
}
function arrObjKeys(obj, inspect2) {
  var isArr = isArray$3(obj);
  var xs = [];
  if (isArr) {
    xs.length = obj.length;
    for (var i = 0; i < obj.length; i++) {
      xs[i] = has$3(obj, i) ? inspect2(obj[i], obj) : "";
    }
  }
  var syms = typeof gOPS === "function" ? gOPS(obj) : [];
  var symMap;
  if (hasShammedSymbols) {
    symMap = {};
    for (var k = 0; k < syms.length; k++) {
      symMap["$" + syms[k]] = syms[k];
    }
  }
  for (var key in obj) {
    if (!has$3(obj, key)) {
      continue;
    }
    if (isArr && String(Number(key)) === key && key < obj.length) {
      continue;
    }
    if (hasShammedSymbols && symMap["$" + key] instanceof Symbol) {
      continue;
    } else if ($test.call(/[^\w$]/, key)) {
      xs.push(inspect2(key, obj) + ": " + inspect2(obj[key], obj));
    } else {
      xs.push(key + ": " + inspect2(obj[key], obj));
    }
  }
  if (typeof gOPS === "function") {
    for (var j = 0; j < syms.length; j++) {
      if (isEnumerable.call(obj, syms[j])) {
        xs.push("[" + inspect2(syms[j]) + "]: " + inspect2(obj[syms[j]], obj));
      }
    }
  }
  return xs;
}
var inspect$3 = objectInspect;
var $TypeError$5 = type;
var listGetNode = function(list, key, isDelete) {
  var prev = list;
  var curr;
  for (; (curr = prev.next) != null; prev = curr) {
    if (curr.key === key) {
      prev.next = curr.next;
      if (!isDelete) {
        curr.next = /** @type {NonNullable<typeof list.next>} */
        list.next;
        list.next = curr;
      }
      return curr;
    }
  }
};
var listGet = function(objects, key) {
  if (!objects) {
    return void 0;
  }
  var node = listGetNode(objects, key);
  return node && node.value;
};
var listSet = function(objects, key, value) {
  var node = listGetNode(objects, key);
  if (node) {
    node.value = value;
  } else {
    objects.next = /** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */
    {
      // eslint-disable-line no-param-reassign, no-extra-parens
      key,
      next: objects.next,
      value
    };
  }
};
var listHas = function(objects, key) {
  if (!objects) {
    return false;
  }
  return !!listGetNode(objects, key);
};
var listDelete = function(objects, key) {
  if (objects) {
    return listGetNode(objects, key, true);
  }
};
var sideChannelList = function getSideChannelList() {
  var $o;
  var channel = {
    assert: function(key) {
      if (!channel.has(key)) {
        throw new $TypeError$5("Side channel does not contain " + inspect$3(key));
      }
    },
    "delete": function(key) {
      var root2 = $o && $o.next;
      var deletedNode = listDelete($o, key);
      if (deletedNode && root2 && root2 === deletedNode) {
        $o = void 0;
      }
      return !!deletedNode;
    },
    get: function(key) {
      return listGet($o, key);
    },
    has: function(key) {
      return listHas($o, key);
    },
    set: function(key, value) {
      if (!$o) {
        $o = {
          next: void 0
        };
      }
      listSet(
        /** @type {NonNullable<typeof $o>} */
        $o,
        key,
        value
      );
    }
  };
  return channel;
};
var esObjectAtoms = Object;
var esErrors = Error;
var _eval = EvalError;
var range = RangeError;
var ref = ReferenceError;
var syntax = SyntaxError;
var uri = URIError;
var abs$1 = Math.abs;
var floor$1 = Math.floor;
var max$2 = Math.max;
var min$1 = Math.min;
var pow$1 = Math.pow;
var round$1 = Math.round;
var _isNaN = Number.isNaN || function isNaN2(a) {
  return a !== a;
};
var $isNaN = _isNaN;
var sign$1 = function sign(number) {
  if ($isNaN(number) || number === 0) {
    return number;
  }
  return number < 0 ? -1 : 1;
};
var gOPD = Object.getOwnPropertyDescriptor;
var $gOPD$1 = gOPD;
if ($gOPD$1) {
  try {
    $gOPD$1([], "length");
  } catch (e) {
    $gOPD$1 = null;
  }
}
var gopd = $gOPD$1;
var $defineProperty$1 = Object.defineProperty || false;
if ($defineProperty$1) {
  try {
    $defineProperty$1({}, "a", { value: 1 });
  } catch (e) {
    $defineProperty$1 = false;
  }
}
var esDefineProperty = $defineProperty$1;
var shams;
var hasRequiredShams;
function requireShams() {
  if (hasRequiredShams)
    return shams;
  hasRequiredShams = 1;
  shams = function hasSymbols2() {
    if (typeof Symbol !== "function" || typeof Object.getOwnPropertySymbols !== "function") {
      return false;
    }
    if (typeof Symbol.iterator === "symbol") {
      return true;
    }
    var obj = {};
    var sym = Symbol("test");
    var symObj = Object(sym);
    if (typeof sym === "string") {
      return false;
    }
    if (Object.prototype.toString.call(sym) !== "[object Symbol]") {
      return false;
    }
    if (Object.prototype.toString.call(symObj) !== "[object Symbol]") {
      return false;
    }
    var symVal = 42;
    obj[sym] = symVal;
    for (var _2 in obj) {
      return false;
    }
    if (typeof Object.keys === "function" && Object.keys(obj).length !== 0) {
      return false;
    }
    if (typeof Object.getOwnPropertyNames === "function" && Object.getOwnPropertyNames(obj).length !== 0) {
      return false;
    }
    var syms = Object.getOwnPropertySymbols(obj);
    if (syms.length !== 1 || syms[0] !== sym) {
      return false;
    }
    if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) {
      return false;
    }
    if (typeof Object.getOwnPropertyDescriptor === "function") {
      var descriptor = (
        /** @type {PropertyDescriptor} */
        Object.getOwnPropertyDescriptor(obj, sym)
      );
      if (descriptor.value !== symVal || descriptor.enumerable !== true) {
        return false;
      }
    }
    return true;
  };
  return shams;
}
var hasSymbols$1;
var hasRequiredHasSymbols;
function requireHasSymbols() {
  if (hasRequiredHasSymbols)
    return hasSymbols$1;
  hasRequiredHasSymbols = 1;
  var origSymbol = typeof Symbol !== "undefined" && Symbol;
  var hasSymbolSham = requireShams();
  hasSymbols$1 = function hasNativeSymbols() {
    if (typeof origSymbol !== "function") {
      return false;
    }
    if (typeof Symbol !== "function") {
      return false;
    }
    if (typeof origSymbol("foo") !== "symbol") {
      return false;
    }
    if (typeof Symbol("bar") !== "symbol") {
      return false;
    }
    return hasSymbolSham();
  };
  return hasSymbols$1;
}
var Reflect_getPrototypeOf;
var hasRequiredReflect_getPrototypeOf;
function requireReflect_getPrototypeOf() {
  if (hasRequiredReflect_getPrototypeOf)
    return Reflect_getPrototypeOf;
  hasRequiredReflect_getPrototypeOf = 1;
  Reflect_getPrototypeOf = typeof Reflect !== "undefined" && Reflect.getPrototypeOf || null;
  return Reflect_getPrototypeOf;
}
var Object_getPrototypeOf;
var hasRequiredObject_getPrototypeOf;
function requireObject_getPrototypeOf() {
  if (hasRequiredObject_getPrototypeOf)
    return Object_getPrototypeOf;
  hasRequiredObject_getPrototypeOf = 1;
  var $Object2 = esObjectAtoms;
  Object_getPrototypeOf = $Object2.getPrototypeOf || null;
  return Object_getPrototypeOf;
}
var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
var toStr = Object.prototype.toString;
var max$1 = Math.max;
var funcType = "[object Function]";
var concatty = function concatty2(a, b) {
  var arr = [];
  for (var i = 0; i < a.length; i += 1) {
    arr[i] = a[i];
  }
  for (var j = 0; j < b.length; j += 1) {
    arr[j + a.length] = b[j];
  }
  return arr;
};
var slicy = function slicy2(arrLike, offset) {
  var arr = [];
  for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
    arr[j] = arrLike[i];
  }
  return arr;
};
var joiny = function(arr, joiner) {
  var str = "";
  for (var i = 0; i < arr.length; i += 1) {
    str += arr[i];
    if (i + 1 < arr.length) {
      str += joiner;
    }
  }
  return str;
};
var implementation$1 = function bind(that) {
  var target = this;
  if (typeof target !== "function" || toStr.apply(target) !== funcType) {
    throw new TypeError(ERROR_MESSAGE + target);
  }
  var args = slicy(arguments, 1);
  var bound;
  var binder = function() {
    if (this instanceof bound) {
      var result = target.apply(
        this,
        concatty(args, arguments)
      );
      if (Object(result) === result) {
        return result;
      }
      return this;
    }
    return target.apply(
      that,
      concatty(args, arguments)
    );
  };
  var boundLength = max$1(0, target.length - args.length);
  var boundArgs = [];
  for (var i = 0; i < boundLength; i++) {
    boundArgs[i] = "$" + i;
  }
  bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
  if (target.prototype) {
    var Empty = function Empty2() {
    };
    Empty.prototype = target.prototype;
    bound.prototype = new Empty();
    Empty.prototype = null;
  }
  return bound;
};
var implementation = implementation$1;
var functionBind = Function.prototype.bind || implementation;
var functionCall = Function.prototype.call;
var functionApply;
var hasRequiredFunctionApply;
function requireFunctionApply() {
  if (hasRequiredFunctionApply)
    return functionApply;
  hasRequiredFunctionApply = 1;
  functionApply = Function.prototype.apply;
  return functionApply;
}
var reflectApply = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
var bind$2 = functionBind;
var $apply$1 = requireFunctionApply();
var $call$2 = functionCall;
var $reflectApply = reflectApply;
var actualApply = $reflectApply || bind$2.call($call$2, $apply$1);
var bind$1 = functionBind;
var $TypeError$4 = type;
var $call$1 = functionCall;
var $actualApply = actualApply;
var callBindApplyHelpers = function callBindBasic(args) {
  if (args.length < 1 || typeof args[0] !== "function") {
    throw new $TypeError$4("a function is required");
  }
  return $actualApply(bind$1, $call$1, args);
};
var get;
var hasRequiredGet;
function requireGet() {
  if (hasRequiredGet)
    return get;
  hasRequiredGet = 1;
  var callBind = callBindApplyHelpers;
  var gOPD2 = gopd;
  var hasProtoAccessor;
  try {
    hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */
    [].__proto__ === Array.prototype;
  } catch (e) {
    if (!e || typeof e !== "object" || !("code" in e) || e.code !== "ERR_PROTO_ACCESS") {
      throw e;
    }
  }
  var desc = !!hasProtoAccessor && gOPD2 && gOPD2(
    Object.prototype,
    /** @type {keyof typeof Object.prototype} */
    "__proto__"
  );
  var $Object2 = Object;
  var $getPrototypeOf = $Object2.getPrototypeOf;
  get = desc && typeof desc.get === "function" ? callBind([desc.get]) : typeof $getPrototypeOf === "function" ? (
    /** @type {import('./get')} */
    function getDunder(value) {
      return $getPrototypeOf(value == null ? value : $Object2(value));
    }
  ) : false;
  return get;
}
var getProto$1;
var hasRequiredGetProto;
function requireGetProto() {
  if (hasRequiredGetProto)
    return getProto$1;
  hasRequiredGetProto = 1;
  var reflectGetProto = requireReflect_getPrototypeOf();
  var originalGetProto = requireObject_getPrototypeOf();
  var getDunderProto = requireGet();
  getProto$1 = reflectGetProto ? function getProto2(O) {
    return reflectGetProto(O);
  } : originalGetProto ? function getProto2(O) {
    if (!O || typeof O !== "object" && typeof O !== "function") {
      throw new TypeError("getProto: not an object");
    }
    return originalGetProto(O);
  } : getDunderProto ? function getProto2(O) {
    return getDunderProto(O);
  } : null;
  return getProto$1;
}
var hasown;
var hasRequiredHasown;
function requireHasown() {
  if (hasRequiredHasown)
    return hasown;
  hasRequiredHasown = 1;
  var call = Function.prototype.call;
  var $hasOwn = Object.prototype.hasOwnProperty;
  var bind3 = functionBind;
  hasown = bind3.call(call, $hasOwn);
  return hasown;
}
var undefined$1;
var $Object = esObjectAtoms;
var $Error = esErrors;
var $EvalError = _eval;
var $RangeError = range;
var $ReferenceError = ref;
var $SyntaxError = syntax;
var $TypeError$3 = type;
var $URIError = uri;
var abs = abs$1;
var floor = floor$1;
var max = max$2;
var min = min$1;
var pow = pow$1;
var round = round$1;
var sign2 = sign$1;
var $Function = Function;
var getEvalledConstructor = function(expressionSyntax) {
  try {
    return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")();
  } catch (e) {
  }
};
var $gOPD = gopd;
var $defineProperty = esDefineProperty;
var throwTypeError = function() {
  throw new $TypeError$3();
};
var ThrowTypeError = $gOPD ? function() {
  try {
    arguments.callee;
    return throwTypeError;
  } catch (calleeThrows) {
    try {
      return $gOPD(arguments, "callee").get;
    } catch (gOPDthrows) {
      return throwTypeError;
    }
  }
}() : throwTypeError;
var hasSymbols = requireHasSymbols()();
var getProto = requireGetProto();
var $ObjectGPO = requireObject_getPrototypeOf();
var $ReflectGPO = requireReflect_getPrototypeOf();
var $apply = requireFunctionApply();
var $call = functionCall;
var needsEval = {};
var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined$1 : getProto(Uint8Array);
var INTRINSICS = {
  __proto__: null,
  "%AggregateError%": typeof AggregateError === "undefined" ? undefined$1 : AggregateError,
  "%Array%": Array,
  "%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined$1 : ArrayBuffer,
  "%ArrayIteratorPrototype%": hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined$1,
  "%AsyncFromSyncIteratorPrototype%": undefined$1,
  "%AsyncFunction%": needsEval,
  "%AsyncGenerator%": needsEval,
  "%AsyncGeneratorFunction%": needsEval,
  "%AsyncIteratorPrototype%": needsEval,
  "%Atomics%": typeof Atomics === "undefined" ? undefined$1 : Atomics,
  "%BigInt%": typeof BigInt === "undefined" ? undefined$1 : BigInt,
  "%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined$1 : BigInt64Array,
  "%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined$1 : BigUint64Array,
  "%Boolean%": Boolean,
  "%DataView%": typeof DataView === "undefined" ? undefined$1 : DataView,
  "%Date%": Date,
  "%decodeURI%": decodeURI,
  "%decodeURIComponent%": decodeURIComponent,
  "%encodeURI%": encodeURI,
  "%encodeURIComponent%": encodeURIComponent,
  "%Error%": $Error,
  "%eval%": eval,
  // eslint-disable-line no-eval
  "%EvalError%": $EvalError,
  "%Float16Array%": typeof Float16Array === "undefined" ? undefined$1 : Float16Array,
  "%Float32Array%": typeof Float32Array === "undefined" ? undefined$1 : Float32Array,
  "%Float64Array%": typeof Float64Array === "undefined" ? undefined$1 : Float64Array,
  "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined$1 : FinalizationRegistry,
  "%Function%": $Function,
  "%GeneratorFunction%": needsEval,
  "%Int8Array%": typeof Int8Array === "undefined" ? undefined$1 : Int8Array,
  "%Int16Array%": typeof Int16Array === "undefined" ? undefined$1 : Int16Array,
  "%Int32Array%": typeof Int32Array === "undefined" ? undefined$1 : Int32Array,
  "%isFinite%": isFinite,
  "%isNaN%": isNaN,
  "%IteratorPrototype%": hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
  "%JSON%": typeof JSON === "object" ? JSON : undefined$1,
  "%Map%": typeof Map === "undefined" ? undefined$1 : Map,
  "%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols || !getProto ? undefined$1 : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()),
  "%Math%": Math,
  "%Number%": Number,
  "%Object%": $Object,
  "%Object.getOwnPropertyDescriptor%": $gOPD,
  "%parseFloat%": parseFloat,
  "%parseInt%": parseInt,
  "%Promise%": typeof Promise === "undefined" ? undefined$1 : Promise,
  "%Proxy%": typeof Proxy === "undefined" ? undefined$1 : Proxy,
  "%RangeError%": $RangeError,
  "%ReferenceError%": $ReferenceError,
  "%Reflect%": typeof Reflect === "undefined" ? undefined$1 : Reflect,
  "%RegExp%": RegExp,
  "%Set%": typeof Set === "undefined" ? undefined$1 : Set,
  "%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols || !getProto ? undefined$1 : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()),
  "%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined$1 : SharedArrayBuffer,
  "%String%": String,
  "%StringIteratorPrototype%": hasSymbols && getProto ? getProto(""[Symbol.iterator]()) : undefined$1,
  "%Symbol%": hasSymbols ? Symbol : undefined$1,
  "%SyntaxError%": $SyntaxError,
  "%ThrowTypeError%": ThrowTypeError,
  "%TypedArray%": TypedArray,
  "%TypeError%": $TypeError$3,
  "%Uint8Array%": typeof Uint8Array === "undefined" ? undefined$1 : Uint8Array,
  "%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined$1 : Uint8ClampedArray,
  "%Uint16Array%": typeof Uint16Array === "undefined" ? undefined$1 : Uint16Array,
  "%Uint32Array%": typeof Uint32Array === "undefined" ? undefined$1 : Uint32Array,
  "%URIError%": $URIError,
  "%WeakMap%": typeof WeakMap === "undefined" ? undefined$1 : WeakMap,
  "%WeakRef%": typeof WeakRef === "undefined" ? undefined$1 : WeakRef,
  "%WeakSet%": typeof WeakSet === "undefined" ? undefined$1 : WeakSet,
  "%Function.prototype.call%": $call,
  "%Function.prototype.apply%": $apply,
  "%Object.defineProperty%": $defineProperty,
  "%Object.getPrototypeOf%": $ObjectGPO,
  "%Math.abs%": abs,
  "%Math.floor%": floor,
  "%Math.max%": max,
  "%Math.min%": min,
  "%Math.pow%": pow,
  "%Math.round%": round,
  "%Math.sign%": sign2,
  "%Reflect.getPrototypeOf%": $ReflectGPO
};
if (getProto) {
  try {
    null.error;
  } catch (e) {
    var errorProto = getProto(getProto(e));
    INTRINSICS["%Error.prototype%"] = errorProto;
  }
}
var doEval = function doEval2(name) {
  var value;
  if (name === "%AsyncFunction%") {
    value = getEvalledConstructor("async function () {}");
  } else if (name === "%GeneratorFunction%") {
    value = getEvalledConstructor("function* () {}");
  } else if (name === "%AsyncGeneratorFunction%") {
    value = getEvalledConstructor("async function* () {}");
  } else if (name === "%AsyncGenerator%") {
    var fn = doEval2("%AsyncGeneratorFunction%");
    if (fn) {
      value = fn.prototype;
    }
  } else if (name === "%AsyncIteratorPrototype%") {
    var gen = doEval2("%AsyncGenerator%");
    if (gen && getProto) {
      value = getProto(gen.prototype);
    }
  }
  INTRINSICS[name] = value;
  return value;
};
var LEGACY_ALIASES = {
  __proto__: null,
  "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
  "%ArrayPrototype%": ["Array", "prototype"],
  "%ArrayProto_entries%": ["Array", "prototype", "entries"],
  "%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
  "%ArrayProto_keys%": ["Array", "prototype", "keys"],
  "%ArrayProto_values%": ["Array", "prototype", "values"],
  "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
  "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
  "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
  "%BooleanPrototype%": ["Boolean", "prototype"],
  "%DataViewPrototype%": ["DataView", "prototype"],
  "%DatePrototype%": ["Date", "prototype"],
  "%ErrorPrototype%": ["Error", "prototype"],
  "%EvalErrorPrototype%": ["EvalError", "prototype"],
  "%Float32ArrayPrototype%": ["Float32Array", "prototype"],
  "%Float64ArrayPrototype%": ["Float64Array", "prototype"],
  "%FunctionPrototype%": ["Function", "prototype"],
  "%Generator%": ["GeneratorFunction", "prototype"],
  "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
  "%Int8ArrayPrototype%": ["Int8Array", "prototype"],
  "%Int16ArrayPrototype%": ["Int16Array", "prototype"],
  "%Int32ArrayPrototype%": ["Int32Array", "prototype"],
  "%JSONParse%": ["JSON", "parse"],
  "%JSONStringify%": ["JSON", "stringify"],
  "%MapPrototype%": ["Map", "prototype"],
  "%NumberPrototype%": ["Number", "prototype"],
  "%ObjectPrototype%": ["Object", "prototype"],
  "%ObjProto_toString%": ["Object", "prototype", "toString"],
  "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
  "%PromisePrototype%": ["Promise", "prototype"],
  "%PromiseProto_then%": ["Promise", "prototype", "then"],
  "%Promise_all%": ["Promise", "all"],
  "%Promise_reject%": ["Promise", "reject"],
  "%Promise_resolve%": ["Promise", "resolve"],
  "%RangeErrorPrototype%": ["RangeError", "prototype"],
  "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
  "%RegExpPrototype%": ["RegExp", "prototype"],
  "%SetPrototype%": ["Set", "prototype"],
  "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
  "%StringPrototype%": ["String", "prototype"],
  "%SymbolPrototype%": ["Symbol", "prototype"],
  "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
  "%TypedArrayPrototype%": ["TypedArray", "prototype"],
  "%TypeErrorPrototype%": ["TypeError", "prototype"],
  "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
  "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
  "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
  "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
  "%URIErrorPrototype%": ["URIError", "prototype"],
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
};
var bind2 = functionBind;
var hasOwn = requireHasown();
var $concat = bind2.call($call, Array.prototype.concat);
var $spliceApply = bind2.call($apply, Array.prototype.splice);
var $replace = bind2.call($call, String.prototype.replace);
var $strSlice = bind2.call($call, String.prototype.slice);
var $exec = bind2.call($call, RegExp.prototype.exec);
var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
var reEscapeChar = /\\(\\)?/g;
var stringToPath = function stringToPath2(string) {
  var first = $strSlice(string, 0, 1);
  var last = $strSlice(string, -1);
  if (first === "%" && last !== "%") {
    throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");
  } else if (last === "%" && first !== "%") {
    throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");
  }
  var result = [];
  $replace(string, rePropName, function(match, number, quote2, subString) {
    result[result.length] = quote2 ? $replace(subString, reEscapeChar, "$1") : number || match;
  });
  return result;
};
var getBaseIntrinsic = function getBaseIntrinsic2(name, allowMissing) {
  var intrinsicName = name;
  var alias;
  if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
    alias = LEGACY_ALIASES[intrinsicName];
    intrinsicName = "%" + alias[0] + "%";
  }
  if (hasOwn(INTRINSICS, intrinsicName)) {
    var value = INTRINSICS[intrinsicName];
    if (value === needsEval) {
      value = doEval(intrinsicName);
    }
    if (typeof value === "undefined" && !allowMissing) {
      throw new $TypeError$3("intrinsic " + name + " exists, but is not available. Please file an issue!");
    }
    return {
      alias,
      name: intrinsicName,
      value
    };
  }
  throw new $SyntaxError("intrinsic " + name + " does not exist!");
};
var getIntrinsic = function GetIntrinsic(name, allowMissing) {
  if (typeof name !== "string" || name.length === 0) {
    throw new $TypeError$3("intrinsic name must be a non-empty string");
  }
  if (arguments.length > 1 && typeof allowMissing !== "boolean") {
    throw new $TypeError$3('"allowMissing" argument must be a boolean');
  }
  if ($exec(/^%?[^%]*%?$/, name) === null) {
    throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
  }
  var parts = stringToPath(name);
  var intrinsicBaseName = parts.length > 0 ? parts[0] : "";
  var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing);
  var intrinsicRealName = intrinsic.name;
  var value = intrinsic.value;
  var skipFurtherCaching = false;
  var alias = intrinsic.alias;
  if (alias) {
    intrinsicBaseName = alias[0];
    $spliceApply(parts, $concat([0, 1], alias));
  }
  for (var i = 1, isOwn = true; i < parts.length; i += 1) {
    var part = parts[i];
    var first = $strSlice(part, 0, 1);
    var last = $strSlice(part, -1);
    if ((first === '"' || first === "'" || first === "`" || (last === '"' || last === "'" || last === "`")) && first !== last) {
      throw new $SyntaxError("property names with quotes must have matching quotes");
    }
    if (part === "constructor" || !isOwn) {
      skipFurtherCaching = true;
    }
    intrinsicBaseName += "." + part;
    intrinsicRealName = "%" + intrinsicBaseName + "%";
    if (hasOwn(INTRINSICS, intrinsicRealName)) {
      value = INTRINSICS[intrinsicRealName];
    } else if (value != null) {
      if (!(part in value)) {
        if (!allowMissing) {
          throw new $TypeError$3("base intrinsic for " + name + " exists, but the property is not available.");
        }
        return void 0;
      }
      if ($gOPD && i + 1 >= parts.length) {
        var desc = $gOPD(value, part);
        isOwn = !!desc;
        if (isOwn && "get" in desc && !("originalValue" in desc.get)) {
          value = desc.get;
        } else {
          value = value[part];
        }
      } else {
        isOwn = hasOwn(value, part);
        value = value[part];
      }
      if (isOwn && !skipFurtherCaching) {
        INTRINSICS[intrinsicRealName] = value;
      }
    }
  }
  return value;
};
var GetIntrinsic$2 = getIntrinsic;
var callBindBasic2 = callBindApplyHelpers;
var $indexOf = callBindBasic2([GetIntrinsic$2("%String.prototype.indexOf%")]);
var callBound$2 = function callBoundIntrinsic(name, allowMissing) {
  var intrinsic = (
    /** @type {(this: unknown, ...args: unknown[]) => unknown} */
    GetIntrinsic$2(name, !!allowMissing)
  );
  if (typeof intrinsic === "function" && $indexOf(name, ".prototype.") > -1) {
    return callBindBasic2(
      /** @type {const} */
      [intrinsic]
    );
  }
  return intrinsic;
};
var GetIntrinsic$1 = getIntrinsic;
var callBound$1 = callBound$2;
var inspect$2 = objectInspect;
var $TypeError$2 = type;
var $Map = GetIntrinsic$1("%Map%", true);
var $mapGet = callBound$1("Map.prototype.get", true);
var $mapSet = callBound$1("Map.prototype.set", true);
var $mapHas = callBound$1("Map.prototype.has", true);
var $mapDelete = callBound$1("Map.prototype.delete", true);
var $mapSize = callBound$1("Map.prototype.size", true);
var sideChannelMap = !!$Map && /** @type {Exclude<import('.'), false>} */
function getSideChannelMap() {
  var $m;
  var channel = {
    assert: function(key) {
      if (!channel.has(key)) {
        throw new $TypeError$2("Side channel does not contain " + inspect$2(key));
      }
    },
    "delete": function(key) {
      if ($m) {
        var result = $mapDelete($m, key);
        if ($mapSize($m) === 0) {
          $m = void 0;
        }
        return result;
      }
      return false;
    },
    get: function(key) {
      if ($m) {
        return $mapGet($m, key);
      }
    },
    has: function(key) {
      if ($m) {
        return $mapHas($m, key);
      }
      return false;
    },
    set: function(key, value) {
      if (!$m) {
        $m = new $Map();
      }
      $mapSet($m, key, value);
    }
  };
  return channel;
};
var GetIntrinsic2 = getIntrinsic;
var callBound = callBound$2;
var inspect$1 = objectInspect;
var getSideChannelMap$1 = sideChannelMap;
var $TypeError$1 = type;
var $WeakMap = GetIntrinsic2("%WeakMap%", true);
var $weakMapGet = callBound("WeakMap.prototype.get", true);
var $weakMapSet = callBound("WeakMap.prototype.set", true);
var $weakMapHas = callBound("WeakMap.prototype.has", true);
var $weakMapDelete = callBound("WeakMap.prototype.delete", true);
var sideChannelWeakmap = $WeakMap ? (
  /** @type {Exclude<import('.'), false>} */
  function getSideChannelWeakMap() {
    var $wm;
    var $m;
    var channel = {
      assert: function(key) {
        if (!channel.has(key)) {
          throw new $TypeError$1("Side channel does not contain " + inspect$1(key));
        }
      },
      "delete": function(key) {
        if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
          if ($wm) {
            return $weakMapDelete($wm, key);
          }
        } else if (getSideChannelMap$1) {
          if ($m) {
            return $m["delete"](key);
          }
        }
        return false;
      },
      get: function(key) {
        if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
          if ($wm) {
            return $weakMapGet($wm, key);
          }
        }
        return $m && $m.get(key);
      },
      has: function(key) {
        if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
          if ($wm) {
            return $weakMapHas($wm, key);
          }
        }
        return !!$m && $m.has(key);
      },
      set: function(key, value) {
        if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
          if (!$wm) {
            $wm = new $WeakMap();
          }
          $weakMapSet($wm, key, value);
        } else if (getSideChannelMap$1) {
          if (!$m) {
            $m = getSideChannelMap$1();
          }
          $m.set(key, value);
        }
      }
    };
    return channel;
  }
) : getSideChannelMap$1;
var $TypeError = type;
var inspect = objectInspect;
var getSideChannelList2 = sideChannelList;
var getSideChannelMap2 = sideChannelMap;
var getSideChannelWeakMap2 = sideChannelWeakmap;
var makeChannel = getSideChannelWeakMap2 || getSideChannelMap2 || getSideChannelList2;
var sideChannel = function getSideChannel() {
  var $channelData;
  var channel = {
    assert: function(key) {
      if (!channel.has(key)) {
        throw new $TypeError("Side channel does not contain " + inspect(key));
      }
    },
    "delete": function(key) {
      return !!$channelData && $channelData["delete"](key);
    },
    get: function(key) {
      return $channelData && $channelData.get(key);
    },
    has: function(key) {
      return !!$channelData && $channelData.has(key);
    },
    set: function(key, value) {
      if (!$channelData) {
        $channelData = makeChannel();
      }
      $channelData.set(key, value);
    }
  };
  return channel;
};
var replace = String.prototype.replace;
var percentTwenties = /%20/g;
var Format = {
  RFC1738: "RFC1738",
  RFC3986: "RFC3986"
};
var formats$3 = {
  "default": Format.RFC3986,
  formatters: {
    RFC1738: function(value) {
      return replace.call(value, percentTwenties, "+");
    },
    RFC3986: function(value) {
      return String(value);
    }
  },
  RFC1738: Format.RFC1738,
  RFC3986: Format.RFC3986
};
var formats$2 = formats$3;
var has$2 = Object.prototype.hasOwnProperty;
var isArray$2 = Array.isArray;
var hexTable = function() {
  var array = [];
  for (var i = 0; i < 256; ++i) {
    array.push("%" + ((i < 16 ? "0" : "") + i.toString(16)).toUpperCase());
  }
  return array;
}();
var compactQueue = function compactQueue2(queue) {
  while (queue.length > 1) {
    var item = queue.pop();
    var obj = item.obj[item.prop];
    if (isArray$2(obj)) {
      var compacted = [];
      for (var j = 0; j < obj.length; ++j) {
        if (typeof obj[j] !== "undefined") {
          compacted.push(obj[j]);
        }
      }
      item.obj[item.prop] = compacted;
    }
  }
};
var arrayToObject = function arrayToObject2(source, options2) {
  var obj = options2 && options2.plainObjects ? { __proto__: null } : {};
  for (var i = 0; i < source.length; ++i) {
    if (typeof source[i] !== "undefined") {
      obj[i] = source[i];
    }
  }
  return obj;
};
var merge = function merge2(target, source, options2) {
  if (!source) {
    return target;
  }
  if (typeof source !== "object" && typeof source !== "function") {
    if (isArray$2(target)) {
      target.push(source);
    } else if (target && typeof target === "object") {
      if (options2 && (options2.plainObjects || options2.allowPrototypes) || !has$2.call(Object.prototype, source)) {
        target[source] = true;
      }
    } else {
      return [target, source];
    }
    return target;
  }
  if (!target || typeof target !== "object") {
    return [target].concat(source);
  }
  var mergeTarget = target;
  if (isArray$2(target) && !isArray$2(source)) {
    mergeTarget = arrayToObject(target, options2);
  }
  if (isArray$2(target) && isArray$2(source)) {
    source.forEach(function(item, i) {
      if (has$2.call(target, i)) {
        var targetItem = target[i];
        if (targetItem && typeof targetItem === "object" && item && typeof item === "object") {
          target[i] = merge2(targetItem, item, options2);
        } else {
          target.push(item);
        }
      } else {
        target[i] = item;
      }
    });
    return target;
  }
  return Object.keys(source).reduce(function(acc, key) {
    var value = source[key];
    if (has$2.call(acc, key)) {
      acc[key] = merge2(acc[key], value, options2);
    } else {
      acc[key] = value;
    }
    return acc;
  }, mergeTarget);
};
var assign = function assignSingleSource(target, source) {
  return Object.keys(source).reduce(function(acc, key) {
    acc[key] = source[key];
    return acc;
  }, target);
};
var decode = function(str, defaultDecoder, charset) {
  var strWithoutPlus = str.replace(/\+/g, " ");
  if (charset === "iso-8859-1") {
    return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
  }
  try {
    return decodeURIComponent(strWithoutPlus);
  } catch (e) {
    return strWithoutPlus;
  }
};
var limit = 1024;
var encode = function encode2(str, defaultEncoder, charset, kind, format) {
  if (str.length === 0) {
    return str;
  }
  var string = str;
  if (typeof str === "symbol") {
    string = Symbol.prototype.toString.call(str);
  } else if (typeof str !== "string") {
    string = String(str);
  }
  if (charset === "iso-8859-1") {
    return escape(string).replace(/%u[0-9a-f]{4}/gi, function($0) {
      return "%26%23" + parseInt($0.slice(2), 16) + "%3B";
    });
  }
  var out = "";
  for (var j = 0; j < string.length; j += limit) {
    var segment = string.length >= limit ? string.slice(j, j + limit) : string;
    var arr = [];
    for (var i = 0; i < segment.length; ++i) {
      var c = segment.charCodeAt(i);
      if (c === 45 || c === 46 || c === 95 || c === 126 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122 || format === formats$2.RFC1738 && (c === 40 || c === 41)) {
        arr[arr.length] = segment.charAt(i);
        continue;
      }
      if (c < 128) {
        arr[arr.length] = hexTable[c];
        continue;
      }
      if (c < 2048) {
        arr[arr.length] = hexTable[192 | c >> 6] + hexTable[128 | c & 63];
        continue;
      }
      if (c < 55296 || c >= 57344) {
        arr[arr.length] = hexTable[224 | c >> 12] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
        continue;
      }
      i += 1;
      c = 65536 + ((c & 1023) << 10 | segment.charCodeAt(i) & 1023);
      arr[arr.length] = hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
    }
    out += arr.join("");
  }
  return out;
};
var compact = function compact2(value) {
  var queue = [{ obj: { o: value }, prop: "o" }];
  var refs = [];
  for (var i = 0; i < queue.length; ++i) {
    var item = queue[i];
    var obj = item.obj[item.prop];
    var keys = Object.keys(obj);
    for (var j = 0; j < keys.length; ++j) {
      var key = keys[j];
      var val = obj[key];
      if (typeof val === "object" && val !== null && refs.indexOf(val) === -1) {
        queue.push({ obj, prop: key });
        refs.push(val);
      }
    }
  }
  compactQueue(queue);
  return value;
};
var isRegExp = function isRegExp2(obj) {
  return Object.prototype.toString.call(obj) === "[object RegExp]";
};
var isBuffer = function isBuffer2(obj) {
  if (!obj || typeof obj !== "object") {
    return false;
  }
  return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
};
var combine = function combine2(a, b) {
  return [].concat(a, b);
};
var maybeMap = function maybeMap2(val, fn) {
  if (isArray$2(val)) {
    var mapped = [];
    for (var i = 0; i < val.length; i += 1) {
      mapped.push(fn(val[i]));
    }
    return mapped;
  }
  return fn(val);
};
var utils$2 = {
  arrayToObject,
  assign,
  combine,
  compact,
  decode,
  encode,
  isBuffer,
  isRegExp,
  maybeMap,
  merge
};
var getSideChannel2 = sideChannel;
var utils$1 = utils$2;
var formats$1 = formats$3;
var has$1 = Object.prototype.hasOwnProperty;
var arrayPrefixGenerators = {
  brackets: function brackets(prefix) {
    return prefix + "[]";
  },
  comma: "comma",
  indices: function indices(prefix, key) {
    return prefix + "[" + key + "]";
  },
  repeat: function repeat(prefix) {
    return prefix;
  }
};
var isArray$1 = Array.isArray;
var push = Array.prototype.push;
var pushToArray = function(arr, valueOrArray) {
  push.apply(arr, isArray$1(valueOrArray) ? valueOrArray : [valueOrArray]);
};
var toISO = Date.prototype.toISOString;
var defaultFormat = formats$1["default"];
var defaults$1 = {
  addQueryPrefix: false,
  allowDots: false,
  allowEmptyArrays: false,
  arrayFormat: "indices",
  charset: "utf-8",
  charsetSentinel: false,
  commaRoundTrip: false,
  delimiter: "&",
  encode: true,
  encodeDotInKeys: false,
  encoder: utils$1.encode,
  encodeValuesOnly: false,
  filter: void 0,
  format: defaultFormat,
  formatter: formats$1.formatters[defaultFormat],
  // deprecated
  indices: false,
  serializeDate: function serializeDate(date) {
    return toISO.call(date);
  },
  skipNulls: false,
  strictNullHandling: false
};
var isNonNullishPrimitive = function isNonNullishPrimitive2(v) {
  return typeof v === "string" || typeof v === "number" || typeof v === "boolean" || typeof v === "symbol" || typeof v === "bigint";
};
var sentinel = {};
var stringify$1 = function stringify(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder, filter, sort, allowDots, serializeDate2, format, formatter, encodeValuesOnly, charset, sideChannel2) {
  var obj = object;
  var tmpSc = sideChannel2;
  var step = 0;
  var findFlag = false;
  while ((tmpSc = tmpSc.get(sentinel)) !== void 0 && !findFlag) {
    var pos = tmpSc.get(object);
    step += 1;
    if (typeof pos !== "undefined") {
      if (pos === step) {
        throw new RangeError("Cyclic object value");
      } else {
        findFlag = true;
      }
    }
    if (typeof tmpSc.get(sentinel) === "undefined") {
      step = 0;
    }
  }
  if (typeof filter === "function") {
    obj = filter(prefix, obj);
  } else if (obj instanceof Date) {
    obj = serializeDate2(obj);
  } else if (generateArrayPrefix === "comma" && isArray$1(obj)) {
    obj = utils$1.maybeMap(obj, function(value2) {
      if (value2 instanceof Date) {
        return serializeDate2(value2);
      }
      return value2;
    });
  }
  if (obj === null) {
    if (strictNullHandling) {
      return encoder && !encodeValuesOnly ? encoder(prefix, defaults$1.encoder, charset, "key", format) : prefix;
    }
    obj = "";
  }
  if (isNonNullishPrimitive(obj) || utils$1.isBuffer(obj)) {
    if (encoder) {
      var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults$1.encoder, charset, "key", format);
      return [formatter(keyValue) + "=" + formatter(encoder(obj, defaults$1.encoder, charset, "value", format))];
    }
    return [formatter(prefix) + "=" + formatter(String(obj))];
  }
  var values = [];
  if (typeof obj === "undefined") {
    return values;
  }
  var objKeys;
  if (generateArrayPrefix === "comma" && isArray$1(obj)) {
    if (encodeValuesOnly && encoder) {
      obj = utils$1.maybeMap(obj, encoder);
    }
    objKeys = [{ value: obj.length > 0 ? obj.join(",") || null : void 0 }];
  } else if (isArray$1(filter)) {
    objKeys = filter;
  } else {
    var keys = Object.keys(obj);
    objKeys = sort ? keys.sort(sort) : keys;
  }
  var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\./g, "%2E") : String(prefix);
  var adjustedPrefix = commaRoundTrip && isArray$1(obj) && obj.length === 1 ? encodedPrefix + "[]" : encodedPrefix;
  if (allowEmptyArrays && isArray$1(obj) && obj.length === 0) {
    return adjustedPrefix + "[]";
  }
  for (var j = 0; j < objKeys.length; ++j) {
    var key = objKeys[j];
    var value = typeof key === "object" && key && typeof key.value !== "undefined" ? key.value : obj[key];
    if (skipNulls && value === null) {
      continue;
    }
    var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\./g, "%2E") : String(key);
    var keyPrefix = isArray$1(obj) ? typeof generateArrayPrefix === "function" ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix : adjustedPrefix + (allowDots ? "." + encodedKey : "[" + encodedKey + "]");
    sideChannel2.set(object, step);
    var valueSideChannel = getSideChannel2();
    valueSideChannel.set(sentinel, sideChannel2);
    pushToArray(values, stringify(
      value,
      keyPrefix,
      generateArrayPrefix,
      commaRoundTrip,
      allowEmptyArrays,
      strictNullHandling,
      skipNulls,
      encodeDotInKeys,
      generateArrayPrefix === "comma" && encodeValuesOnly && isArray$1(obj) ? null : encoder,
      filter,
      sort,
      allowDots,
      serializeDate2,
      format,
      formatter,
      encodeValuesOnly,
      charset,
      valueSideChannel
    ));
  }
  return values;
};
var normalizeStringifyOptions = function normalizeStringifyOptions2(opts) {
  if (!opts) {
    return defaults$1;
  }
  if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") {
    throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
  }
  if (typeof opts.encodeDotInKeys !== "undefined" && typeof opts.encodeDotInKeys !== "boolean") {
    throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");
  }
  if (opts.encoder !== null && typeof opts.encoder !== "undefined" && typeof opts.encoder !== "function") {
    throw new TypeError("Encoder has to be a function.");
  }
  var charset = opts.charset || defaults$1.charset;
  if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") {
    throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
  }
  var format = formats$1["default"];
  if (typeof opts.format !== "undefined") {
    if (!has$1.call(formats$1.formatters, opts.format)) {
      throw new TypeError("Unknown format option provided.");
    }
    format = opts.format;
  }
  var formatter = formats$1.formatters[format];
  var filter = defaults$1.filter;
  if (typeof opts.filter === "function" || isArray$1(opts.filter)) {
    filter = opts.filter;
  }
  var arrayFormat;
  if (opts.arrayFormat in arrayPrefixGenerators) {
    arrayFormat = opts.arrayFormat;
  } else if ("indices" in opts) {
    arrayFormat = opts.indices ? "indices" : "repeat";
  } else {
    arrayFormat = defaults$1.arrayFormat;
  }
  if ("commaRoundTrip" in opts && typeof opts.commaRoundTrip !== "boolean") {
    throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
  }
  var allowDots = typeof opts.allowDots === "undefined" ? opts.encodeDotInKeys === true ? true : defaults$1.allowDots : !!opts.allowDots;
  return {
    addQueryPrefix: typeof opts.addQueryPrefix === "boolean" ? opts.addQueryPrefix : defaults$1.addQueryPrefix,
    allowDots,
    allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults$1.allowEmptyArrays,
    arrayFormat,
    charset,
    charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults$1.charsetSentinel,
    commaRoundTrip: !!opts.commaRoundTrip,
    delimiter: typeof opts.delimiter === "undefined" ? defaults$1.delimiter : opts.delimiter,
    encode: typeof opts.encode === "boolean" ? opts.encode : defaults$1.encode,
    encodeDotInKeys: typeof opts.encodeDotInKeys === "boolean" ? opts.encodeDotInKeys : defaults$1.encodeDotInKeys,
    encoder: typeof opts.encoder === "function" ? opts.encoder : defaults$1.encoder,
    encodeValuesOnly: typeof opts.encodeValuesOnly === "boolean" ? opts.encodeValuesOnly : defaults$1.encodeValuesOnly,
    filter,
    format,
    formatter,
    serializeDate: typeof opts.serializeDate === "function" ? opts.serializeDate : defaults$1.serializeDate,
    skipNulls: typeof opts.skipNulls === "boolean" ? opts.skipNulls : defaults$1.skipNulls,
    sort: typeof opts.sort === "function" ? opts.sort : null,
    strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults$1.strictNullHandling
  };
};
var stringify_1 = function(object, opts) {
  var obj = object;
  var options2 = normalizeStringifyOptions(opts);
  var objKeys;
  var filter;
  if (typeof options2.filter === "function") {
    filter = options2.filter;
    obj = filter("", obj);
  } else if (isArray$1(options2.filter)) {
    filter = options2.filter;
    objKeys = filter;
  }
  var keys = [];
  if (typeof obj !== "object" || obj === null) {
    return "";
  }
  var generateArrayPrefix = arrayPrefixGenerators[options2.arrayFormat];
  var commaRoundTrip = generateArrayPrefix === "comma" && options2.commaRoundTrip;
  if (!objKeys) {
    objKeys = Object.keys(obj);
  }
  if (options2.sort) {
    objKeys.sort(options2.sort);
  }
  var sideChannel2 = getSideChannel2();
  for (var i = 0; i < objKeys.length; ++i) {
    var key = objKeys[i];
    var value = obj[key];
    if (options2.skipNulls && value === null) {
      continue;
    }
    pushToArray(keys, stringify$1(
      value,
      key,
      generateArrayPrefix,
      commaRoundTrip,
      options2.allowEmptyArrays,
      options2.strictNullHandling,
      options2.skipNulls,
      options2.encodeDotInKeys,
      options2.encode ? options2.encoder : null,
      options2.filter,
      options2.sort,
      options2.allowDots,
      options2.serializeDate,
      options2.format,
      options2.formatter,
      options2.encodeValuesOnly,
      options2.charset,
      sideChannel2
    ));
  }
  var joined = keys.join(options2.delimiter);
  var prefix = options2.addQueryPrefix === true ? "?" : "";
  if (options2.charsetSentinel) {
    if (options2.charset === "iso-8859-1") {
      prefix += "utf8=%26%2310003%3B&";
    } else {
      prefix += "utf8=%E2%9C%93&";
    }
  }
  return joined.length > 0 ? prefix + joined : "";
};
var utils = utils$2;
var has = Object.prototype.hasOwnProperty;
var isArray = Array.isArray;
var defaults = {
  allowDots: false,
  allowEmptyArrays: false,
  allowPrototypes: false,
  allowSparse: false,
  arrayLimit: 20,
  charset: "utf-8",
  charsetSentinel: false,
  comma: false,
  decodeDotInKeys: false,
  decoder: utils.decode,
  delimiter: "&",
  depth: 5,
  duplicates: "combine",
  ignoreQueryPrefix: false,
  interpretNumericEntities: false,
  parameterLimit: 1e3,
  parseArrays: true,
  plainObjects: false,
  strictDepth: false,
  strictNullHandling: false
};
var interpretNumericEntities = function(str) {
  return str.replace(/&#(\d+);/g, function($0, numberStr) {
    return String.fromCharCode(parseInt(numberStr, 10));
  });
};
var parseArrayValue = function(val, options2) {
  if (val && typeof val === "string" && options2.comma && val.indexOf(",") > -1) {
    return val.split(",");
  }
  return val;
};
var isoSentinel = "utf8=%26%2310003%3B";
var charsetSentinel = "utf8=%E2%9C%93";
var parseValues = function parseQueryStringValues(str, options2) {
  var obj = { __proto__: null };
  var cleanStr = options2.ignoreQueryPrefix ? str.replace(/^\?/, "") : str;
  cleanStr = cleanStr.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
  var limit2 = options2.parameterLimit === Infinity ? void 0 : options2.parameterLimit;
  var parts = cleanStr.split(options2.delimiter, limit2);
  var skipIndex = -1;
  var i;
  var charset = options2.charset;
  if (options2.charsetSentinel) {
    for (i = 0; i < parts.length; ++i) {
      if (parts[i].indexOf("utf8=") === 0) {
        if (parts[i] === charsetSentinel) {
          charset = "utf-8";
        } else if (parts[i] === isoSentinel) {
          charset = "iso-8859-1";
        }
        skipIndex = i;
        i = parts.length;
      }
    }
  }
  for (i = 0; i < parts.length; ++i) {
    if (i === skipIndex) {
      continue;
    }
    var part = parts[i];
    var bracketEqualsPos = part.indexOf("]=");
    var pos = bracketEqualsPos === -1 ? part.indexOf("=") : bracketEqualsPos + 1;
    var key;
    var val;
    if (pos === -1) {
      key = options2.decoder(part, defaults.decoder, charset, "key");
      val = options2.strictNullHandling ? null : "";
    } else {
      key = options2.decoder(part.slice(0, pos), defaults.decoder, charset, "key");
      val = utils.maybeMap(
        parseArrayValue(part.slice(pos + 1), options2),
        function(encodedVal) {
          return options2.decoder(encodedVal, defaults.decoder, charset, "value");
        }
      );
    }
    if (val && options2.interpretNumericEntities && charset === "iso-8859-1") {
      val = interpretNumericEntities(String(val));
    }
    if (part.indexOf("[]=") > -1) {
      val = isArray(val) ? [val] : val;
    }
    var existing = has.call(obj, key);
    if (existing && options2.duplicates === "combine") {
      obj[key] = utils.combine(obj[key], val);
    } else if (!existing || options2.duplicates === "last") {
      obj[key] = val;
    }
  }
  return obj;
};
var parseObject = function(chain, val, options2, valuesParsed) {
  var leaf = valuesParsed ? val : parseArrayValue(val, options2);
  for (var i = chain.length - 1; i >= 0; --i) {
    var obj;
    var root2 = chain[i];
    if (root2 === "[]" && options2.parseArrays) {
      obj = options2.allowEmptyArrays && (leaf === "" || options2.strictNullHandling && leaf === null) ? [] : [].concat(leaf);
    } else {
      obj = options2.plainObjects ? { __proto__: null } : {};
      var cleanRoot = root2.charAt(0) === "[" && root2.charAt(root2.length - 1) === "]" ? root2.slice(1, -1) : root2;
      var decodedRoot = options2.decodeDotInKeys ? cleanRoot.replace(/%2E/g, ".") : cleanRoot;
      var index = parseInt(decodedRoot, 10);
      if (!options2.parseArrays && decodedRoot === "") {
        obj = { 0: leaf };
      } else if (!isNaN(index) && root2 !== decodedRoot && String(index) === decodedRoot && index >= 0 && (options2.parseArrays && index <= options2.arrayLimit)) {
        obj = [];
        obj[index] = leaf;
      } else if (decodedRoot !== "__proto__") {
        obj[decodedRoot] = leaf;
      }
    }
    leaf = obj;
  }
  return leaf;
};
var parseKeys = function parseQueryStringKeys(givenKey, val, options2, valuesParsed) {
  if (!givenKey) {
    return;
  }
  var key = options2.allowDots ? givenKey.replace(/\.([^.[]+)/g, "[$1]") : givenKey;
  var brackets2 = /(\[[^[\]]*])/;
  var child = /(\[[^[\]]*])/g;
  var segment = options2.depth > 0 && brackets2.exec(key);
  var parent = segment ? key.slice(0, segment.index) : key;
  var keys = [];
  if (parent) {
    if (!options2.plainObjects && has.call(Object.prototype, parent)) {
      if (!options2.allowPrototypes) {
        return;
      }
    }
    keys.push(parent);
  }
  var i = 0;
  while (options2.depth > 0 && (segment = child.exec(key)) !== null && i < options2.depth) {
    i += 1;
    if (!options2.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
      if (!options2.allowPrototypes) {
        return;
      }
    }
    keys.push(segment[1]);
  }
  if (segment) {
    if (options2.strictDepth === true) {
      throw new RangeError("Input depth exceeded depth option of " + options2.depth + " and strictDepth is true");
    }
    keys.push("[" + key.slice(segment.index) + "]");
  }
  return parseObject(keys, val, options2, valuesParsed);
};
var normalizeParseOptions = function normalizeParseOptions2(opts) {
  if (!opts) {
    return defaults;
  }
  if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") {
    throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
  }
  if (typeof opts.decodeDotInKeys !== "undefined" && typeof opts.decodeDotInKeys !== "boolean") {
    throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");
  }
  if (opts.decoder !== null && typeof opts.decoder !== "undefined" && typeof opts.decoder !== "function") {
    throw new TypeError("Decoder has to be a function.");
  }
  if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") {
    throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
  }
  var charset = typeof opts.charset === "undefined" ? defaults.charset : opts.charset;
  var duplicates = typeof opts.duplicates === "undefined" ? defaults.duplicates : opts.duplicates;
  if (duplicates !== "combine" && duplicates !== "first" && duplicates !== "last") {
    throw new TypeError("The duplicates option must be either combine, first, or last");
  }
  var allowDots = typeof opts.allowDots === "undefined" ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
  return {
    allowDots,
    allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
    allowPrototypes: typeof opts.allowPrototypes === "boolean" ? opts.allowPrototypes : defaults.allowPrototypes,
    allowSparse: typeof opts.allowSparse === "boolean" ? opts.allowSparse : defaults.allowSparse,
    arrayLimit: typeof opts.arrayLimit === "number" ? opts.arrayLimit : defaults.arrayLimit,
    charset,
    charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults.charsetSentinel,
    comma: typeof opts.comma === "boolean" ? opts.comma : defaults.comma,
    decodeDotInKeys: typeof opts.decodeDotInKeys === "boolean" ? opts.decodeDotInKeys : defaults.decodeDotInKeys,
    decoder: typeof opts.decoder === "function" ? opts.decoder : defaults.decoder,
    delimiter: typeof opts.delimiter === "string" || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
    // eslint-disable-next-line no-implicit-coercion, no-extra-parens
    depth: typeof opts.depth === "number" || opts.depth === false ? +opts.depth : defaults.depth,
    duplicates,
    ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
    interpretNumericEntities: typeof opts.interpretNumericEntities === "boolean" ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
    parameterLimit: typeof opts.parameterLimit === "number" ? opts.parameterLimit : defaults.parameterLimit,
    parseArrays: opts.parseArrays !== false,
    plainObjects: typeof opts.plainObjects === "boolean" ? opts.plainObjects : defaults.plainObjects,
    strictDepth: typeof opts.strictDepth === "boolean" ? !!opts.strictDepth : defaults.strictDepth,
    strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults.strictNullHandling
  };
};
var parse$1 = function(str, opts) {
  var options2 = normalizeParseOptions(opts);
  if (str === "" || str === null || typeof str === "undefined") {
    return options2.plainObjects ? { __proto__: null } : {};
  }
  var tempObj = typeof str === "string" ? parseValues(str, options2) : str;
  var obj = options2.plainObjects ? { __proto__: null } : {};
  var keys = Object.keys(tempObj);
  for (var i = 0; i < keys.length; ++i) {
    var key = keys[i];
    var newObj = parseKeys(key, tempObj[key], options2, typeof str === "string");
    obj = utils.merge(obj, newObj, options2);
  }
  if (options2.allowSparse === true) {
    return obj;
  }
  return utils.compact(obj);
};
var stringify2 = stringify_1;
var parse = parse$1;
var formats = formats$3;
var lib = {
  formats,
  parse,
  stringify: stringify2
};
const qs = /* @__PURE__ */ getDefaultExportFromCjs(lib);
var dayjs_min = { exports: {} };
(function(module, exports) {
  !function(t, e) {
    module.exports = e();
  }(commonjsGlobal, function() {
    var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t2) {
      var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
      return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
    } }, m = function(t2, e2, n2) {
      var r2 = String(t2);
      return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2;
    }, v = { s: m, z: function(t2) {
      var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60;
      return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
    }, m: function t2(e2, n2) {
      if (e2.date() < n2.date())
        return -t2(n2, e2);
      var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, c), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), c);
      return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
    }, a: function(t2) {
      return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
    }, p: function(t2) {
      return { M: c, y: h, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: f }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
    }, u: function(t2) {
      return void 0 === t2;
    } }, g = "en", D = {};
    D[g] = M;
    var p = "$isDayjsObject", S = function(t2) {
      return t2 instanceof _2 || !(!t2 || !t2[p]);
    }, w = function t2(e2, n2, r2) {
      var i2;
      if (!e2)
        return g;
      if ("string" == typeof e2) {
        var s2 = e2.toLowerCase();
        D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
        var u2 = e2.split("-");
        if (!i2 && u2.length > 1)
          return t2(u2[0]);
      } else {
        var a2 = e2.name;
        D[a2] = e2, i2 = a2;
      }
      return !r2 && i2 && (g = i2), i2 || !r2 && g;
    }, O = function(t2, e2) {
      if (S(t2))
        return t2.clone();
      var n2 = "object" == typeof e2 ? e2 : {};
      return n2.date = t2, n2.args = arguments, new _2(n2);
    }, b = v;
    b.l = w, b.i = S, b.w = function(t2, e2) {
      return O(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
    };
    var _2 = function() {
      function M2(t2) {
        this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p] = true;
      }
      var m2 = M2.prototype;
      return m2.parse = function(t2) {
        this.$d = function(t3) {
          var e2 = t3.date, n2 = t3.utc;
          if (null === e2)
            return /* @__PURE__ */ new Date(NaN);
          if (b.u(e2))
            return /* @__PURE__ */ new Date();
          if (e2 instanceof Date)
            return new Date(e2);
          if ("string" == typeof e2 && !/Z$/i.test(e2)) {
            var r2 = e2.match($);
            if (r2) {
              var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
              return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2);
            }
          }
          return new Date(e2);
        }(t2), this.init();
      }, m2.init = function() {
        var t2 = this.$d;
        this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
      }, m2.$utils = function() {
        return b;
      }, m2.isValid = function() {
        return !(this.$d.toString() === l);
      }, m2.isSame = function(t2, e2) {
        var n2 = O(t2);
        return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
      }, m2.isAfter = function(t2, e2) {
        return O(t2) < this.startOf(e2);
      }, m2.isBefore = function(t2, e2) {
        return this.endOf(e2) < O(t2);
      }, m2.$g = function(t2, e2, n2) {
        return b.u(t2) ? this[e2] : this.set(n2, t2);
      }, m2.unix = function() {
        return Math.floor(this.valueOf() / 1e3);
      }, m2.valueOf = function() {
        return this.$d.getTime();
      }, m2.startOf = function(t2, e2) {
        var n2 = this, r2 = !!b.u(e2) || e2, f2 = b.p(t2), l2 = function(t3, e3) {
          var i2 = b.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
          return r2 ? i2 : i2.endOf(a);
        }, $2 = function(t3, e3) {
          return b.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
        }, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
        switch (f2) {
          case h:
            return r2 ? l2(1, 0) : l2(31, 11);
          case c:
            return r2 ? l2(1, M3) : l2(0, M3 + 1);
          case o:
            var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
            return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
          case a:
          case d:
            return $2(v2 + "Hours", 0);
          case u:
            return $2(v2 + "Minutes", 1);
          case s:
            return $2(v2 + "Seconds", 2);
          case i:
            return $2(v2 + "Milliseconds", 3);
          default:
            return this.clone();
        }
      }, m2.endOf = function(t2) {
        return this.startOf(t2, false);
      }, m2.$set = function(t2, e2) {
        var n2, o2 = b.p(t2), f2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = f2 + "Date", n2[d] = f2 + "Date", n2[c] = f2 + "Month", n2[h] = f2 + "FullYear", n2[u] = f2 + "Hours", n2[s] = f2 + "Minutes", n2[i] = f2 + "Seconds", n2[r] = f2 + "Milliseconds", n2)[o2], $2 = o2 === a ? this.$D + (e2 - this.$W) : e2;
        if (o2 === c || o2 === h) {
          var y2 = this.clone().set(d, 1);
          y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
        } else
          l2 && this.$d[l2]($2);
        return this.init(), this;
      }, m2.set = function(t2, e2) {
        return this.clone().$set(t2, e2);
      }, m2.get = function(t2) {
        return this[b.p(t2)]();
      }, m2.add = function(r2, f2) {
        var d2, l2 = this;
        r2 = Number(r2);
        var $2 = b.p(f2), y2 = function(t2) {
          var e2 = O(l2);
          return b.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
        };
        if ($2 === c)
          return this.set(c, this.$M + r2);
        if ($2 === h)
          return this.set(h, this.$y + r2);
        if ($2 === a)
          return y2(1);
        if ($2 === o)
          return y2(7);
        var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3;
        return b.w(m3, this);
      }, m2.subtract = function(t2, e2) {
        return this.add(-1 * t2, e2);
      }, m2.format = function(t2) {
        var e2 = this, n2 = this.$locale();
        if (!this.isValid())
          return n2.invalidDate || l;
        var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = b.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, c2 = n2.months, f2 = n2.meridiem, h2 = function(t3, n3, i3, s3) {
          return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
        }, d2 = function(t3) {
          return b.s(s2 % 12 || 12, t3, "0");
        }, $2 = f2 || function(t3, e3, n3) {
          var r3 = t3 < 12 ? "AM" : "PM";
          return n3 ? r3.toLowerCase() : r3;
        };
        return r2.replace(y, function(t3, r3) {
          return r3 || function(t4) {
            switch (t4) {
              case "YY":
                return String(e2.$y).slice(-2);
              case "YYYY":
                return b.s(e2.$y, 4, "0");
              case "M":
                return a2 + 1;
              case "MM":
                return b.s(a2 + 1, 2, "0");
              case "MMM":
                return h2(n2.monthsShort, a2, c2, 3);
              case "MMMM":
                return h2(c2, a2);
              case "D":
                return e2.$D;
              case "DD":
                return b.s(e2.$D, 2, "0");
              case "d":
                return String(e2.$W);
              case "dd":
                return h2(n2.weekdaysMin, e2.$W, o2, 2);
              case "ddd":
                return h2(n2.weekdaysShort, e2.$W, o2, 3);
              case "dddd":
                return o2[e2.$W];
              case "H":
                return String(s2);
              case "HH":
                return b.s(s2, 2, "0");
              case "h":
                return d2(1);
              case "hh":
                return d2(2);
              case "a":
                return $2(s2, u2, true);
              case "A":
                return $2(s2, u2, false);
              case "m":
                return String(u2);
              case "mm":
                return b.s(u2, 2, "0");
              case "s":
                return String(e2.$s);
              case "ss":
                return b.s(e2.$s, 2, "0");
              case "SSS":
                return b.s(e2.$ms, 3, "0");
              case "Z":
                return i2;
            }
            return null;
          }(t3) || i2.replace(":", "");
        });
      }, m2.utcOffset = function() {
        return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
      }, m2.diff = function(r2, d2, l2) {
        var $2, y2 = this, M3 = b.p(d2), m3 = O(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
          return b.m(y2, m3);
        };
        switch (M3) {
          case h:
            $2 = D2() / 12;
            break;
          case c:
            $2 = D2();
            break;
          case f:
            $2 = D2() / 3;
            break;
          case o:
            $2 = (g2 - v2) / 6048e5;
            break;
          case a:
            $2 = (g2 - v2) / 864e5;
            break;
          case u:
            $2 = g2 / n;
            break;
          case s:
            $2 = g2 / e;
            break;
          case i:
            $2 = g2 / t;
            break;
          default:
            $2 = g2;
        }
        return l2 ? $2 : b.a($2);
      }, m2.daysInMonth = function() {
        return this.endOf(c).$D;
      }, m2.$locale = function() {
        return D[this.$L];
      }, m2.locale = function(t2, e2) {
        if (!t2)
          return this.$L;
        var n2 = this.clone(), r2 = w(t2, e2, true);
        return r2 && (n2.$L = r2), n2;
      }, m2.clone = function() {
        return b.w(this.$d, this);
      }, m2.toDate = function() {
        return new Date(this.valueOf());
      }, m2.toJSON = function() {
        return this.isValid() ? this.toISOString() : null;
      }, m2.toISOString = function() {
        return this.$d.toISOString();
      }, m2.toString = function() {
        return this.$d.toUTCString();
      }, M2;
    }(), k = _2.prototype;
    return O.prototype = k, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach(function(t2) {
      k[t2[1]] = function(e2) {
        return this.$g(e2, t2[0], t2[1]);
      };
    }), O.extend = function(t2, e2) {
      return t2.$i || (t2(e2, _2, O), t2.$i = true), O;
    }, O.locale = w, O.isDayjs = S, O.unix = function(t2) {
      return O(1e3 * t2);
    }, O.en = D[g], O.Ls = D, O.p = {}, O;
  });
})(dayjs_min);
var dayjs_minExports = dayjs_min.exports;
const dayjs = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports);
function Http(options2) {
  const _axios = axios.create(options2);
  _axios.defaults.headers.post["Content-Type"] = "application/json";
  _axios.defaults.headers.put["Content-Type"] = "application/json";
  _axios.interceptors.request.use(
    (config) => {
      config.headers["grant_type"] = "service_code";
      config.headers["appCode"] = "workflow";
      config.headers["schoolId"] = "3a0481ab-9313-a3a2-6d48-835e78b0327a";
      return config;
    },
    (error) => {
      console.error(error);
      return Promise.reject(error);
    }
  );
  _axios.interceptors.response.use(
    (response) => {
      const { config } = response;
      if (config.responseType && config.responseType === "blob") {
        const url = window.URL.createObjectURL(response.data);
        if (response.config.headers["xzx_preview"])
          return url;
        let fileName = "";
        const cd = response.headers["content-disposition"];
        if (cd) {
          fileName = decodeURI(cd.split("''")[1]);
        }
        if (!fileName) {
          fileName = dayjs().format("YYYYMMDDHHMMSSS");
        }
        const link = document.createElement("a");
        link.href = url;
        link.setAttribute("download", fileName);
        document.body.appendChild(link);
        link.click();
        document.body.removeChild(link);
        return;
      } else if (response.data.success) {
        return response.data.result || { success: true };
      } else if (!response.data.success) {
        return Promise.reject(response.data.message);
      } else {
        return response.data;
      }
    },
    (error) => {
      if (error && error.response) {
        return Promise.reject(error);
      }
      return Promise.reject(error);
    }
  );
  this._axios = _axios;
}
Http.prototype.post = function(url, params, config) {
  return this._axios.post(url, params, config);
};
Http.prototype.get = function(url, params, config) {
  const config_ = Object.assign({}, config, {
    // 参数
    params,
    // 修改参数序列化方法
    paramsSerializer: (p) => {
      return qs.stringify(p, {
        allowDots: true
      });
    }
  });
  return this._axios.get(url, config_);
};
Http.prototype.download = function(url, params, config) {
  const config_ = Object.assign({ responseType: "blob" }, config, {
    // 参数
    params,
    // 修改参数序列化方法
    paramsSerializer: (p) => {
      return qs.stringify(p, {
        allowDots: true
      });
    }
  });
  return this._axios.get(url, config_);
};
Http.prototype.preview = function(url, params, config) {
  const config_ = Object.assign({ responseType: "blob", headers: { xzx_preview: true } }, config, {
    // 参数
    params,
    // 修改参数序列化方法
    paramsSerializer: (p) => {
      return qs.stringify(p, {
        allowDots: true
      });
    }
  });
  return this._axios.get(url, config_);
};
Http.prototype.getUrl = function(url) {
  return combineURLs$1(this._axios.defaults.baseURL, url);
};
const request = new Http({
  baseURL: "https://k12wx.xzxyun.com",
  // 本地测试用
  timeout: 3e4
});
const install = (app, request$1 = request, message = useMessage) => {
  app.use(components$1);
  app.config.globalProperties.$message = message();
  app.config.globalProperties.$axios = request$1;
};
const install$1 = {
  install
};
export {
  DetailForm,
  ImageViewer,
  RenderForm,
  install$1 as default
};
import './style.css';
import './assets/iconfont.js';
import './assets/iconfont.css';
